openclaw-abacusai-auth 1.2.2 → 1.2.3
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/index.ts +15 -1
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -421,7 +421,10 @@ function cleanSchema(schema: unknown): unknown {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
|
-
* Strip `strict` field from tools
|
|
424
|
+
* Strip `strict` field from tools, clean schemas, and promote name/parameters
|
|
425
|
+
* to the top level of each tool object for RouteLLM compatibility.
|
|
426
|
+
* RouteLLM expects `name` and `parameters` accessible at the tool level,
|
|
427
|
+
* not only nested under `function`.
|
|
425
428
|
*/
|
|
426
429
|
function normalizeToolsForRouteLLM(tools: unknown[]): unknown[] {
|
|
427
430
|
return tools.map((t) => {
|
|
@@ -441,6 +444,17 @@ function normalizeToolsForRouteLLM(tools: unknown[]): unknown[] {
|
|
|
441
444
|
}
|
|
442
445
|
|
|
443
446
|
copy.function = fn;
|
|
447
|
+
|
|
448
|
+
// Promote name and parameters to top level for RouteLLM
|
|
449
|
+
if (fn.name && !copy.name) {
|
|
450
|
+
copy.name = fn.name;
|
|
451
|
+
}
|
|
452
|
+
if (fn.parameters !== undefined && copy.parameters === undefined) {
|
|
453
|
+
copy.parameters = fn.parameters;
|
|
454
|
+
}
|
|
455
|
+
if (fn.description && !copy.description) {
|
|
456
|
+
copy.description = fn.description;
|
|
457
|
+
}
|
|
444
458
|
}
|
|
445
459
|
|
|
446
460
|
return copy;
|