File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,6 @@ const sendMessageToOpenAI = async (
26
26
upsreamUrl : string ,
27
27
prompt ?: string
28
28
) => {
29
- // console.log("apiKey", apiKey);
30
- // console.log("isValidApiKey(apiKey)", isValidApiKey(apiKey).toString());
31
- // console.log(
32
- // " token的值",
33
- // "Bearer " +
34
- // (isValidApiKey(apiKey) ? apiKey : process.env.NEXT_PUBLIC_OPENAI_API_KEY)
35
- // );
36
29
//识别应该使用的模型
37
30
let model = selectedModel === "gpt3.5" ? "gpt-3.5-turbo" : "gpt-4" ;
38
31
console . log ( "upstreamUrl" , upsreamUrl ) ;
@@ -88,10 +81,9 @@ const sendMessageToOpenAI = async (
88
81
}
89
82
const reader = response . body . getReader ( ) ;
90
83
const decoder = new TextDecoder ( ) ;
91
-
92
- await processResult ( reader , decoder , editor ) ;
93
- console . log ( "流式输出完成接下来要插入一个换行符" ) ;
84
+ //开始结束前先进行换行
94
85
editor . insertText ( editor . getSelection ( ) . index , "\n" ) ;
86
+ await processResult ( reader , decoder , editor ) ;
95
87
96
88
convertToSuperscript ( editor ) ;
97
89
updateBracketNumbersInDeltaKeepSelection ( editor ) ;
You can’t perform that action at this time.
0 commit comments