File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 ( {
You can’t perform that action at this time.
0 commit comments