@zenmux/rosetta-ai 1.0.14 → 1.0.15
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.
|
@@ -13,8 +13,9 @@ import type OpenAI from "openai";
|
|
|
13
13
|
*
|
|
14
14
|
* Downstream provider protocols (chat-completions / messages / gemini) do not
|
|
15
15
|
* understand the `namespace` tool type, so each inner tool is flattened into a
|
|
16
|
-
* top-level function tool whose name is namespaced as `<namespace
|
|
17
|
-
* (e.g. `
|
|
16
|
+
* top-level function tool whose name is namespaced as `<namespace>_<tool>`
|
|
17
|
+
* (e.g. `agents_spawn_agent`). An underscore separator is used (not a dot) so
|
|
18
|
+
* the name matches the provider's required pattern `^[a-zA-Z0-9_-]+$`.
|
|
18
19
|
*
|
|
19
20
|
* Non-namespace tools pass through untouched and the original order is
|
|
20
21
|
* preserved (a namespace expands in place). When no namespace tool is present
|
package/dist/responses/utils.js
CHANGED
|
@@ -15,8 +15,9 @@ exports.expandNamespaceTools = expandNamespaceTools;
|
|
|
15
15
|
*
|
|
16
16
|
* Downstream provider protocols (chat-completions / messages / gemini) do not
|
|
17
17
|
* understand the `namespace` tool type, so each inner tool is flattened into a
|
|
18
|
-
* top-level function tool whose name is namespaced as `<namespace
|
|
19
|
-
* (e.g. `
|
|
18
|
+
* top-level function tool whose name is namespaced as `<namespace>_<tool>`
|
|
19
|
+
* (e.g. `agents_spawn_agent`). An underscore separator is used (not a dot) so
|
|
20
|
+
* the name matches the provider's required pattern `^[a-zA-Z0-9_-]+$`.
|
|
20
21
|
*
|
|
21
22
|
* Non-namespace tools pass through untouched and the original order is
|
|
22
23
|
* preserved (a namespace expands in place). When no namespace tool is present
|
|
@@ -43,7 +44,7 @@ function expandNamespaceTools(tools) {
|
|
|
43
44
|
expanded.push({
|
|
44
45
|
...inner,
|
|
45
46
|
type: "function",
|
|
46
|
-
name: nsName ? `${nsName}
|
|
47
|
+
name: nsName ? `${nsName}_${innerName}` : innerName,
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
continue;
|