graphlit-client 1.0.20250610001 → 1.0.20250610003
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/streaming/providers.js +13 -8
- package/package.json +1 -1
@@ -221,13 +221,17 @@ onEvent, onComplete) {
|
|
221
221
|
}));
|
222
222
|
}
|
223
223
|
// Configure tools for Google - expects a single array of function declarations
|
224
|
-
const googleTools = tools && tools.length > 0
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
224
|
+
const googleTools = tools && tools.length > 0
|
225
|
+
? [
|
226
|
+
{
|
227
|
+
functionDeclarations: tools.map((tool) => ({
|
228
|
+
name: tool.name,
|
229
|
+
description: tool.description,
|
230
|
+
parameters: tool.schema ? JSON.parse(tool.schema) : {},
|
231
|
+
})),
|
232
|
+
},
|
233
|
+
]
|
234
|
+
: undefined;
|
231
235
|
const model = googleClient.getGenerativeModel({
|
232
236
|
model: modelName,
|
233
237
|
generationConfig: {
|
@@ -311,7 +315,8 @@ onEvent, onComplete) {
|
|
311
315
|
}
|
312
316
|
}
|
313
317
|
// Check for function calls
|
314
|
-
if (part.functionCall &&
|
318
|
+
if (part.functionCall &&
|
319
|
+
!toolCalls.some((tc) => tc.name === part.functionCall.name)) {
|
315
320
|
const toolCall = {
|
316
321
|
id: `google_tool_${Date.now()}_${toolCalls.length}`,
|
317
322
|
name: part.functionCall.name,
|