Skip to content

Commit 7864e1a

Browse files
Report sources in API responses on finalized chunk (#4396)
1 parent 50d4a19 commit 7864e1a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server/utils/chats/apiChatHandler.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,7 @@ async function streamChat({
665665
const stream = await LLMConnector.streamGetChatCompletion(messages, {
666666
temperature: workspace?.openAiTemp ?? LLMConnector.defaultTemp,
667667
});
668-
completeText = await LLMConnector.handleStream(response, stream, {
669-
uuid,
670-
sources,
671-
});
668+
completeText = await LLMConnector.handleStream(response, stream, { uuid });
672669
metrics = stream.metrics;
673670
}
674671

@@ -695,6 +692,7 @@ async function streamChat({
695692
error: false,
696693
chatId: chat.id,
697694
metrics,
695+
sources,
698696
});
699697
return;
700698
}

0 commit comments

Comments
 (0)