Report sources in API responses on finalized chunk (#4396)

This commit is contained in:
Timothy Carambat 2025-09-17 15:16:35 -07:00 committed by GitHub
parent 50d4a198a4
commit 7864e1a970
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -665,10 +665,7 @@ async function streamChat({
const stream = await LLMConnector.streamGetChatCompletion(messages, {
temperature: workspace?.openAiTemp ?? LLMConnector.defaultTemp,
});
completeText = await LLMConnector.handleStream(response, stream, {
uuid,
sources,
});
completeText = await LLMConnector.handleStream(response, stream, { uuid });
metrics = stream.metrics;
}
@ -695,6 +692,7 @@ async function streamChat({
error: false,
chatId: chat.id,
metrics,
sources,
});
return;
}