matt HOFFNER commited on
Commit
b446577
·
1 Parent(s): bf8ef54
Files changed (1) hide show
  1. src/pages/api/stream.js +1 -5
src/pages/api/stream.js CHANGED
@@ -73,12 +73,8 @@ export const LLMStream = async (
73
  const data = event.data;
74
 
75
  try {
76
- if (data === '[DONE]') {
77
- controller.close();
78
- return;
79
- }
80
  const json = JSON.parse(data);
81
- if (json.choices[0].finish_reason === "stop") {
82
  controller.close();
83
  return;
84
  } else if (json.choices[0].finish_reason === "function_call") {
 
73
  const data = event.data;
74
 
75
  try {
 
 
 
 
76
  const json = JSON.parse(data);
77
+ if (json.choices[0].finish_reason === "stop" || data === '[DONE]') {
78
  controller.close();
79
  return;
80
  } else if (json.choices[0].finish_reason === "function_call") {