Spaces:
Paused
Paused
matt HOFFNER
commited on
Commit
·
dfd767d
1
Parent(s):
0f9859f
log
Browse files- src/pages/api/stream.js +6 -3
src/pages/api/stream.js
CHANGED
@@ -106,12 +106,15 @@ export const LLMStream = async (
|
|
106 |
}
|
107 |
|
108 |
if (choice.finish_reason === "function_call") {
|
|
|
109 |
// function call here using func_call
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
// const serpQueue = encoder.encode(funcResult);
|
114 |
// controller.enqueue(serpQueue);
|
|
|
|
|
115 |
}
|
116 |
|
117 |
if (delta && 'content' in delta) {
|
|
|
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) {
|