matt HOFFNER commited on
Commit
048048c
·
1 Parent(s): dfd767d
Files changed (1) hide show
  1. src/pages/api/stream.js +3 -6
src/pages/api/stream.js CHANGED
@@ -106,15 +106,12 @@ export const LLMStream = async (
106
  }
107
 
108
  if (choice.finish_reason === "function_call") {
109
-
110
  // function call here using func_call
 
111
  const fn = functions[func_call.name]['googleCustomSearch'];
112
  const funcResult = await fn(JSON.parse(func_call.arguments));
113
- console.log(JSON.stringify(funcResult));
114
- // const serpQueue = encoder.encode(funcResult);
115
- // controller.enqueue(serpQueue);
116
- controller.close();
117
- return;
118
  }
119
 
120
  if (delta && 'content' in delta) {
 
106
  }
107
 
108
  if (choice.finish_reason === "function_call") {
 
109
  // function call here using func_call
110
+ console.log(func_call.name, choice);
111
  const fn = functions[func_call.name]['googleCustomSearch'];
112
  const funcResult = await fn(JSON.parse(func_call.arguments));
113
+ const serpQueue = encoder.encode(JSON.stringify(funcResult));
114
+ controller.enqueue(serpQueue);
 
 
 
115
  }
116
 
117
  if (delta && 'content' in delta) {