Skip to content

Commit 2065c36

Browse files
committed
fix
1 parent 2ebae7a commit 2065c36

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/server/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ export const ChatStream = async (
3939
}
4040
const res = await fetch(queryUrl, {
4141
headers: {
42-
'accept': "application/json",
43-
'Content-Type': "text/event-stream"
42+
'accept': "*/*",
43+
'Content-Type': "application/json",
44+
Authorization: `Bearer ${key ? key : process.env.OPENAI_API_KEY}`
4445
},
4546
method: 'POST',
4647
body: JSON.stringify({
@@ -64,7 +65,9 @@ export const ChatWithoutStream = async (
6465
let queryUrl = `${api}/v1/chat/completions`;
6566
const res = await fetch(queryUrl, {
6667
headers: {
68+
'accept': "*/*",
6769
'Content-Type': 'application/json',
70+
Authorization: `Bearer ${key ? key : process.env.OPENAI_API_KEY}`
6871
},
6972
method: 'POST',
7073
body: JSON.stringify({

0 commit comments

Comments
 (0)