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