Skip to content

Commit

Permalink
feat: 支持不联网模式 weaigc#93
Browse files Browse the repository at this point in the history
  • Loading branch information
weaigc committed Nov 19, 2023
1 parent 2889570 commit c047313
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion OPENAI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 是否使用流式输出,默认为

### 出参
Expand Down Expand Up @@ -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
});
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Bingo,一个让你呼吸顺畅 New Bing。
- [x] 支持内置提示词
- [x] 支持 Workers 部署
- [x] 支持 OpenAI API
- [x] 支持 GPT4 模式
- [ ] 国际化翻译

## 在线部署
Expand Down
Binary file modified docs/images/wechat2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bingo",
"version": "1.2.0",
"version": "1.3.0",
"private": true,
"main": "./cloudflare/cli.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/openai/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
}
Expand Down

0 comments on commit c047313

Please sign in to comment.