diff --git a/OPENAI.md b/OPENAI.md index 69613ade..ca00b081 100644 --- a/OPENAI.md +++ b/OPENAI.md @@ -8,7 +8,7 @@ * Content-Type: application/json * 参数说明 * messages 输入的消息列表,完整格式参见 https://platform.openai.com/docs/guides/gpt/chat-completions-api - * model 模型名称(此字段被用于指定 new bing 风格,参数为 Creative、Balanced、Precise 中的一种) + * model 模型名称(此字段被用于指定 new bing 风格,参数为 Creative、Balanced、Precise、gpt-4 中的一种) * stream 是否使用流式输出,默认为 ### 出参 @@ -70,6 +70,7 @@ for chat_completion in completion: import OpenAI from 'openai'; const openai = new OpenAI({ + apiKey: 'dummy', baseURL: 'https://copilot.github1s.tk' // 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0 }); diff --git a/README.md b/README.md index cd50560e..898e96af 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Bingo,一个让你呼吸顺畅 New Bing。 - [x] 支持内置提示词 - [x] 支持 Workers 部署 - [x] 支持 OpenAI API + - [x] 支持 GPT4 模式 - [ ] 国际化翻译 ## 在线部署 diff --git a/docs/images/wechat2.jpg b/docs/images/wechat2.jpg index 77e3614c..1c00bdae 100644 Binary files a/docs/images/wechat2.jpg and b/docs/images/wechat2.jpg differ diff --git a/package.json b/package.json index afd4c9e4..af9ee525 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bingo", - "version": "1.2.0", + "version": "1.3.0", "private": true, "main": "./cloudflare/cli.js", "scripts": { diff --git a/src/pages/api/openai/chat/completions.ts b/src/pages/api/openai/chat/completions.ts index c4b34e38..27eacba2 100644 --- a/src/pages/api/openai/chat/completions.ts +++ b/src/pages/api/openai/chat/completions.ts @@ -33,7 +33,7 @@ function parseOpenAIMessage(request: APIRequest) { prompt, context, stream: request.stream, - allowSearch: /gpt\-?4/i.test(request.model), + allowSearch: /gpt-?4/i.test(request.model), model: /Creative|gpt-?4/i.test(request.model) ? 'Creative' : 'Balanced', }; }