chore
This commit is contained in:
parent
f6614ff4dc
commit
ff6240d798
@ -583,8 +583,9 @@ const ChatPanel: FC = observer(() => {
|
|||||||
}),
|
}),
|
||||||
signal: chatSseController?.signal,
|
signal: chatSseController?.signal,
|
||||||
onmessage(e) {
|
onmessage(e) {
|
||||||
|
if (finished) return;
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
if (!finished && e.data.trim() === '[DONE]') {
|
if (e.data.trim() === '[DONE]') {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -598,7 +599,7 @@ const ChatPanel: FC = observer(() => {
|
|||||||
if (data.model)
|
if (data.model)
|
||||||
commonStore.setLastModelName(data.model);
|
commonStore.setLastModelName(data.model);
|
||||||
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
||||||
if (!finished && data.choices[0]?.finish_reason) {
|
if (data.choices[0]?.finish_reason) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -109,8 +109,9 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
}),
|
}),
|
||||||
signal: completionSseController?.signal,
|
signal: completionSseController?.signal,
|
||||||
onmessage(e) {
|
onmessage(e) {
|
||||||
|
if (finished) return;
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
if (!finished && e.data.trim() === '[DONE]') {
|
if (e.data.trim() === '[DONE]') {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -124,7 +125,7 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
if (data.model)
|
if (data.model)
|
||||||
commonStore.setLastModelName(data.model);
|
commonStore.setLastModelName(data.model);
|
||||||
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
||||||
if (!finished && data.choices[0]?.finish_reason) {
|
if (data.choices[0]?.finish_reason) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -214,8 +214,9 @@ const CompositionPanel: FC = observer(() => {
|
|||||||
}),
|
}),
|
||||||
signal: compositionSseController?.signal,
|
signal: compositionSseController?.signal,
|
||||||
onmessage(e) {
|
onmessage(e) {
|
||||||
|
if (finished) return;
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
if (!finished && e.data.trim() === '[DONE]') {
|
if (e.data.trim() === '[DONE]') {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -229,7 +230,7 @@ const CompositionPanel: FC = observer(() => {
|
|||||||
if (data.model)
|
if (data.model)
|
||||||
commonStore.setLastModelName(data.model);
|
commonStore.setLastModelName(data.model);
|
||||||
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
||||||
if (!finished && data.choices[0]?.finish_reason) {
|
if (data.choices[0]?.finish_reason) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user