Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 24, 2024
1 parent e3006b0 commit a3b7d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/services/apis/custom-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
pushRecord(session, question, answer)
console.debug('conversation history', { content: session.conversationRecords })
port.postMessage({ answer: null, done: true, session: session })
return
}

if (data.response) answer = data.response
Expand Down
2 changes: 2 additions & 0 deletions src/services/apis/openai-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export async function generateAnswersWithGptCompletionApi(
pushRecord(session, question, answer)
console.debug('conversation history', { content: session.conversationRecords })
port.postMessage({ answer: null, done: true, session: session })
return
}

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

const delta = data.choices[0]?.delta?.content
Expand Down

0 comments on commit a3b7d2c

Please sign in to comment.