mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix: aichat response (#2728)
This commit is contained in:
@@ -201,13 +201,15 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
|||||||
const unStreamResponse = response as ChatCompletion;
|
const unStreamResponse = response as ChatCompletion;
|
||||||
const answer = unStreamResponse.choices?.[0]?.message?.content || '';
|
const answer = unStreamResponse.choices?.[0]?.message?.content || '';
|
||||||
|
|
||||||
// Some models do not support streaming
|
if (stream) {
|
||||||
workflowStreamResponse?.({
|
// Some models do not support streaming
|
||||||
event: SseResponseEventEnum.fastAnswer,
|
workflowStreamResponse?.({
|
||||||
data: textAdaptGptResponse({
|
event: SseResponseEventEnum.fastAnswer,
|
||||||
text: answer
|
data: textAdaptGptResponse({
|
||||||
})
|
text: answer
|
||||||
});
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
answerText: answer
|
answerText: answer
|
||||||
|
Reference in New Issue
Block a user