mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix: completions delta
This commit is contained in:
@@ -74,7 +74,7 @@ export const streamFetch = ({
|
||||
if (!eventName || !data) return;
|
||||
|
||||
if (eventName === sseResponseEventEnum.answer && data !== '[DONE]') {
|
||||
const answer: string = data?.choices?.[0].delta.content || '';
|
||||
const answer: string = data?.choices?.[0]?.delta?.content || '';
|
||||
onMessage({ text: answer });
|
||||
responseText += answer;
|
||||
} else if (
|
||||
|
@@ -324,7 +324,7 @@ async function streamResponse({
|
||||
const { data } = parseData.parse(item);
|
||||
if (!data || data === '[DONE]') return;
|
||||
|
||||
const content: string = data?.choices?.[0].delta.content || '';
|
||||
const content: string = data?.choices?.[0]?.delta?.content || '';
|
||||
error = data.error;
|
||||
answer += content;
|
||||
|
||||
|
Reference in New Issue
Block a user