Commit 539bc779 by Archer Committed by GitHub

fix: aichat response (#2728)

parent aabbe06e
......@@ -201,6 +201,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
const unStreamResponse = response as ChatCompletion;
const answer = unStreamResponse.choices?.[0]?.message?.content || '';
if (stream) {
// Some models do not support streaming
workflowStreamResponse?.({
event: SseResponseEventEnum.fastAnswer,
......@@ -208,6 +209,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
text: answer
})
});
}
return {
answerText: answer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment