File tree 5 files changed +5
-3
lines changed
src/pages/api/openai/chat
5 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 8
8
* Content-Type: application/json
9
9
* 参数说明
10
10
* 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 中的一种)
12
12
* stream 是否使用流式输出,默认为
13
13
14
14
### 出参
@@ -70,6 +70,7 @@ for chat_completion in completion:
70
70
import OpenAI from 'openai';
71
71
72
72
const openai = new OpenAI({
73
+ apiKey: 'dummy',
73
74
baseURL: 'https://copilot.github1s.tk' // 这里可以改为你自己部署的服务,bingo 服务版本需要 >= 0.9.0
74
75
});
75
76
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Bingo,一个让你呼吸顺畅 New Bing。
52
52
- [x] 支持内置提示词
53
53
- [x] 支持 Workers 部署
54
54
- [x] 支持 OpenAI API
55
+ - [x] 支持 GPT4 模式
55
56
- [ ] 国际化翻译
56
57
57
58
## 在线部署
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bingo" ,
3
- "version" : " 1.2 .0" ,
3
+ "version" : " 1.3 .0" ,
4
4
"private" : true ,
5
5
"main" : " ./cloudflare/cli.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function parseOpenAIMessage(request: APIRequest) {
33
33
prompt,
34
34
context,
35
35
stream : request . stream ,
36
- allowSearch : / g p t \ -? 4 / i. test ( request . model ) ,
36
+ allowSearch : / g p t - ? 4 / i. test ( request . model ) ,
37
37
model : / C r e a t i v e | g p t - ? 4 / i. test ( request . model ) ? 'Creative' : 'Balanced' ,
38
38
} ;
39
39
}
You can’t perform that action at this time.
0 commit comments