diff --git a/README.md b/README.md index c87469f..d4699ad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ This is a replication project for the typescript version of [gpt4free](https://github.com/xtekky/gpt4free) +[中文](README_zh.md) + ## Demo [GPTGOD](http://gptgod.site) ### GPTGOD Support diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..226f8ef --- /dev/null +++ b/README_zh.md @@ -0,0 +1,182 @@ +[English](README.md) + +## 示例项目 [GPTGOD](http://gptgod.site) + +### GPTGOD 现已支持 + +- [x] Midjourney 史上最强的AI画图 +- [x] Stable Diffusion 史上最强的开源AI画图 +- [x] Claude 仅次于gpt4的AI语言模型 +- [x] Chatgpt 都知道 +- [x] Chatgpt with internet 联网的chatgpt +- [x] 以上所有功能,都能在网站中,一个步骤集成到微信机器人中 + +GPTGOD 会在稳定之后,完全开源,如果你感兴趣的话请关注我 + +## 目标 + +拼命更新中,期待您的PR.... + +下面是已经可以转成api的网站: +如果你发现你的网站在此列表,并且不想他出现,请联系我去除 +|model|support|status|active time| +|--|--|--|--| +|[ai.mcbbs.gq](https://ai.mcbbs.gq)|gpt3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-06-03| +|[forefront.ai](https://chat.forefront.ai)|GPT-4/gpt3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after +2023-06-03| +|[aidream](http://aidream.cloud)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-05-12| +|[you.com](you.com)|GPT-3.5|![Active](https://img.shields.io/badge/Active-brightgreen)|after 2023-05-12 +|[phind.com](https://www.phind.com/)|GPT-4 / Internet / good search|![Active](https://img.shields.io/badge/Active-grey)| +|[bing.com/chat](bing.com/chat)|GPT-4/3.5|| +|[poe.com](poe.com)| GPT-4/3.5|| +|[writesonic.com](writesonic.com)| GPT-3.5 / Internet|| +|[t3nsor.com](t3nsor.com)|GPT-3.5|| + +## 本地运行 + +```shell +# install module +yarn +# start server +yarn start +``` + +## 使用Docker运行 + +### 1. 首先创建环境文件 `.env` + +```env +http_proxy=http://host:port +# 如果你使用forefront的话,`rapid_api_key` 必填 +# 这里获取 https://rapidapi.com/calvinloveland335703-0p6BxLYIH8f/api/temp-mail44 +# 这里获取 https://rapidapi.com/Privatix/api/temp-mail +rapid_api_key=xxxxxxxxxx +# 临时邮箱类型 `temp-email44:不需要绑定信用卡,但是每天限死100条调用` `temp-email: 需要绑定信用卡,每天免费100条,之后付费` +EMAIL_TYPE=temp-email44 +DEBUG=0 # 目前仅forefront用到 默认是0 一般本地运行可以设置成1,可以看到网站运行过程 +POOL_SIZE=3 # 目前仅forefront用到 启用线程数,默认3 即代表同时可以进行3个会话 +``` + +### 2. 运行 + +``` +docker run --env-file .env xiangsx/gpt4free-ts:latest +``` + +## 使用`docker-compose`部署 + +### 1. 参照 docker步骤创建 `.env`文件 + +### 2. 部署 + +``` +docker-compose up --build -d +``` + +## API使用说明 + +### 参数介绍 + +#### 1. 通用参数 + +```typescript +interface query { + prompt: string; // 有些网站不需要 + model: string; // 必填 +} +``` + +#### 2. 各个网站特有参数 + +##### forefront(默认使用gpt4,其他模型需要修改代码) + +无 + +##### mcbbs + +```typescript +interface Message { + role: string; + content: string; +} + +interface options { + parse: string; + messages: string; // attattion messages is Message[] json string + temperature: number; +} + +``` + +### 开始使用 + +普通API,等待整个会话结束才返回 + +```shell +# 使用 mcbbs + +curl '127.0.0.1:3000/ask?messages=[{"role":"system","content":"IMPORTANT: You are a virtual assistant powered by the gpt-3.5-turbo model, now time is 2023/6/3 13:42:27}"},{"role":"user","content":"你好\n"},{"role":"assistant","content":"你好!有什么我可以帮助你的吗?"},{"role":"user","content":"写个冒泡排序\n"}]&prompt=test&model=mcbbs&parse=false' + +# 使用 chat.forefront Default,use gpt4 +curl "http://127.0.0.1:3000/ask?prompt=hello&model=forefront" +``` + +request event-stream + +```shell +# test model mcbbs +curl '127.0.0.1:3000/ask/stream?messages=[{"role":"system","content":"IMPORTANT: You are a virtual assistant powered by the gpt-3.5-turbo model, now time is 2023/6/3 13:42:27}"},{"role":"user","content":"你好\n"},{"role":"assistant","content":"你好!有什么我可以帮助你的吗?"},{"role":"user","content":"写个冒泡排序\n"}]&prompt=test&model=mcbbs&parse=false' + +# test model forefront, use gpt4 +curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=forefront" + +# test you +curl "http://127.0.0.1:3000/ask/stream?prompt=hello&model=you" +``` + +## 🌟 Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=xiangsx/gpt4free-ts&type=Date)](https://star-history.com/#xiangsx/gpt4free-ts&&type=Date) + +
You may join our discord: discord.gg/gpt4free for further updates.