Skip to content

Commit

Permalink
feat: openai 支持网页端调用
Browse files Browse the repository at this point in the history
  • Loading branch information
weaigc committed Sep 22, 2023
1 parent 5b7b6dc commit 935212e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 134 deletions.
36 changes: 34 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"next": "13.4.19",
"next-auth": "^4.23.1",
"next-themes": "^0.2.1",
"nextjs-cors": "^2.1.2",
"node-imei": "^1.0.8",
"postcss": "8.4.29",
"random-ip": "^0.0.1",
Expand Down
108 changes: 0 additions & 108 deletions src/pages/api/chat/completions.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/api/turing/conversation/create.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const runtime = 'experimental-edge'
export const runtime = 'edge'

const API_ENDPOINT = 'https://www.bing.com/turing/conversation/create'

Expand Down
22 changes: 0 additions & 22 deletions src/pages/middleware.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tests/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import OpenAI from 'openai';

const openai = new OpenAI({
apiKey: 'dummy',
baseURL: 'http://127.0.0.1:3000/api'
baseURL: 'https://bing.github1s.tk/api/openai/v1' // 这里改成你自己部署的服务地址
});

async function start() {
Expand Down

0 comments on commit 935212e

Please sign in to comment.