Skip to content

Commit c047313

Browse files
committed
feat: 支持不联网模式 #93
1 parent 2889570 commit c047313

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

OPENAI.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Content-Type: application/json
99
* 参数说明
1010
* messages 输入的消息列表,完整格式参见 https://platform.openai.com/docs/guides/gpt/chat-completions-api
11-
* model 模型名称(此字段被用于指定 new bing 风格,参数为 Creative、Balanced、Precise 中的一种)
11+
* model 模型名称(此字段被用于指定 new bing 风格,参数为 Creative、Balanced、Precise、gpt-4 中的一种)
1212
* stream 是否使用流式输出,默认为
1313

1414
### 出参
@@ -70,6 +70,7 @@ for chat_completion in completion:
7070
import OpenAI from 'openai';
7171
7272
const openai = new OpenAI({
73+
apiKey: 'dummy',
7374
baseURL: 'https://copilot.github1s.tk' // 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0
7475
});
7576

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Bingo,一个让你呼吸顺畅 New Bing。
5252
- [x] 支持内置提示词
5353
- [x] 支持 Workers 部署
5454
- [x] 支持 OpenAI API
55+
- [x] 支持 GPT4 模式
5556
- [ ] 国际化翻译
5657

5758
## 在线部署

docs/images/wechat2.jpg

9.47 KB
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bingo",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"private": true,
55
"main": "./cloudflare/cli.js",
66
"scripts": {

src/pages/api/openai/chat/completions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function parseOpenAIMessage(request: APIRequest) {
3333
prompt,
3434
context,
3535
stream: request.stream,
36-
allowSearch: /gpt\-?4/i.test(request.model),
36+
allowSearch: /gpt-?4/i.test(request.model),
3737
model: /Creative|gpt-?4/i.test(request.model) ? 'Creative' : 'Balanced',
3838
};
3939
}

0 commit comments

Comments
 (0)