@ai-sdk-tool/parser 2.1.6 → 2.1.7
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/README.md +2 -2
- package/dist/chunk-GSD5HDOQ.js +2068 -0
- package/dist/chunk-GSD5HDOQ.js.map +1 -0
- package/dist/community.cjs +2164 -0
- package/dist/community.cjs.map +1 -0
- package/dist/community.d.cts +20 -0
- package/dist/community.d.ts +20 -0
- package/dist/community.js +98 -0
- package/dist/community.js.map +1 -0
- package/dist/index.cjs +23 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -2038
- package/dist/index.js.map +1 -1
- package/package.json +13 -1
package/dist/index.cjs
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
33
|
RJSON: () => robust_json_exports,
|
|
34
34
|
createDynamicIfThenElseSchema: () => createDynamicIfThenElseSchema,
|
|
35
35
|
createToolMiddleware: () => createToolMiddleware,
|
|
@@ -51,10 +51,10 @@ __export(index_exports, {
|
|
|
51
51
|
logParsedSummary: () => logParsedSummary,
|
|
52
52
|
logRawChunk: () => logRawChunk,
|
|
53
53
|
morphXmlProtocol: () => morphXmlProtocol,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
morphXmlToolMiddleware: () => morphXmlToolMiddleware,
|
|
55
|
+
originalToolsSchema: () => originalToolsSchema
|
|
56
56
|
});
|
|
57
|
-
module.exports = __toCommonJS(
|
|
57
|
+
module.exports = __toCommonJS(src_exports);
|
|
58
58
|
|
|
59
59
|
// src/protocols/dummy-protocol.ts
|
|
60
60
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
@@ -2068,21 +2068,26 @@ For each function call return a json object with function name and arguments wit
|
|
|
2068
2068
|
</tool_call>`;
|
|
2069
2069
|
}
|
|
2070
2070
|
});
|
|
2071
|
-
var
|
|
2071
|
+
var morphXmlToolMiddleware = createToolMiddleware({
|
|
2072
2072
|
protocol: morphXmlProtocol,
|
|
2073
2073
|
toolSystemPromptTemplate(tools) {
|
|
2074
2074
|
return `You are a function calling AI model.
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2075
|
+
|
|
2076
|
+
Available functions are listed inside <tools></tools>.
|
|
2077
|
+
<tools>${tools}</tools>
|
|
2078
|
+
|
|
2079
|
+
# Rules
|
|
2080
|
+
- Use exactly one XML element whose tag name is the function name.
|
|
2081
|
+
- Put each parameter as a child element.
|
|
2082
|
+
- Values must follow the schema exactly (numbers, arrays, objects, enums \u2192 copy as-is).
|
|
2083
|
+
- Do not add or remove functions or parameters.
|
|
2084
|
+
- Each required parameter must appear once.
|
|
2085
|
+
- Output nothing before or after the function call.
|
|
2086
|
+
|
|
2087
|
+
# Example
|
|
2082
2088
|
<get_weather>
|
|
2083
|
-
<location>
|
|
2084
|
-
|
|
2085
|
-
</location>
|
|
2089
|
+
<location>New York</location>
|
|
2090
|
+
<unit>celsius</unit>
|
|
2086
2091
|
</get_weather>`;
|
|
2087
2092
|
}
|
|
2088
2093
|
});
|
|
@@ -2109,7 +2114,7 @@ San Francisco
|
|
|
2109
2114
|
logParsedSummary,
|
|
2110
2115
|
logRawChunk,
|
|
2111
2116
|
morphXmlProtocol,
|
|
2112
|
-
|
|
2113
|
-
|
|
2117
|
+
morphXmlToolMiddleware,
|
|
2118
|
+
originalToolsSchema
|
|
2114
2119
|
});
|
|
2115
2120
|
//# sourceMappingURL=index.cjs.map
|