Skip to content

Commit a3b7d2c

Browse files
committed
chore
1 parent e3006b0 commit a3b7d2c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/services/apis/custom-api.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
6767
pushRecord(session, question, answer)
6868
console.debug('conversation history', { content: session.conversationRecords })
6969
port.postMessage({ answer: null, done: true, session: session })
70+
return
7071
}
7172

7273
if (data.response) answer = data.response

src/services/apis/openai-api.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export async function generateAnswersWithGptCompletionApi(
7575
pushRecord(session, question, answer)
7676
console.debug('conversation history', { content: session.conversationRecords })
7777
port.postMessage({ answer: null, done: true, session: session })
78+
return
7879
}
7980

8081
answer += data.choices[0].text
@@ -170,6 +171,7 @@ export async function generateAnswersWithChatgptApiCompat(
170171
pushRecord(session, question, answer)
171172
console.debug('conversation history', { content: session.conversationRecords })
172173
port.postMessage({ answer: null, done: true, session: session })
174+
return
173175
}
174176

175177
const delta = data.choices[0]?.delta?.content

0 commit comments

Comments
 (0)