@ai-sdk-tool/parser 3.0.0-canary.2 → 3.0.0
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/chunk-DFOXAWP6.js +1 -0
- package/dist/chunk-DFOXAWP6.js.map +1 -0
- package/dist/chunk-NOYHOQOL.js +2489 -0
- package/dist/chunk-NOYHOQOL.js.map +1 -0
- package/dist/chunk-QPJA5CS6.js +1289 -0
- package/dist/chunk-QPJA5CS6.js.map +1 -0
- package/dist/community.cjs +2665 -2493
- package/dist/community.cjs.map +1 -1
- package/dist/community.js +5 -2
- package/dist/community.js.map +1 -1
- package/dist/index.cjs +2691 -2485
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -132
- package/dist/index.d.ts +25 -132
- package/dist/index.js +19 -8
- package/dist/tool-call-protocol-Bn2CBcD-.d.cts +84 -0
- package/dist/tool-call-protocol-Bn2CBcD-.d.ts +84 -0
- package/dist/v5.cjs +2816 -0
- package/dist/v5.cjs.map +1 -0
- package/dist/v5.d.cts +14 -0
- package/dist/v5.d.ts +14 -0
- package/dist/v5.js +476 -0
- package/dist/v5.js.map +1 -0
- package/dist/{chunk-LB5ALTRD.js → v6.cjs} +1198 -1067
- package/dist/v6.cjs.map +1 -0
- package/dist/v6.d.cts +16 -0
- package/dist/v6.d.ts +16 -0
- package/dist/v6.js +16 -0
- package/dist/v6.js.map +1 -0
- package/package.json +23 -8
- package/dist/chunk-LB5ALTRD.js.map +0 -1
package/dist/community.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import "./chunk-DFOXAWP6.js";
|
|
2
|
+
import {
|
|
3
|
+
createToolMiddleware
|
|
4
|
+
} from "./chunk-QPJA5CS6.js";
|
|
1
5
|
import {
|
|
2
|
-
createToolMiddleware,
|
|
3
6
|
morphXmlProtocol
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NOYHOQOL.js";
|
|
5
8
|
|
|
6
9
|
// src/community/sijawara.ts
|
|
7
10
|
var sijawaraDetailedXmlToolMiddleware = createToolMiddleware({
|
package/dist/community.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/community/sijawara.ts"],"sourcesContent":["import { createToolMiddleware, morphXmlProtocol } from \"../index\";\n\n/**\n * A community-contributed middleware that uses morphXmlProtocol\n * with a more detailed system prompt template for function calling.\n *\n * Originally contributed by: sijawara\n * Source: https://github.com/minpeter/ai-sdk-tool-call-middleware/issues/51#issuecomment-3234519376\n */\nexport const sijawaraDetailedXmlToolMiddleware = createToolMiddleware({\n protocol: morphXmlProtocol,\n toolSystemPromptTemplate(tools: string) {\n return `You have access to callable functions (tools).\n Tool list/context:\n ${tools}\n\n ===============================\n TOOL CALLING FORMAT\n ===============================\n - Use the XML-like format for tool calls:\n <tool_name>\n <parameter_name>\n value\n </parameter_name>\n ...\n </tool_name>\n\n ===============================\n ARRAY PARAMETERS\n ===============================\n - For array/multiple values, repeat the parameter for each value.\n - Example:\n <send_messages>\n <recipient>\n alice@example.com\n </recipient>\n <recipient>\n bob@example.com\n </recipient>\n <message>\n Hello!\n </message>\n </send_messages>\n\n ===============================\n SINGLE VALUE PARAMETERS\n ===============================\n - For single values, use one parameter block.\n - Example:\n <get_weather>\n <location>\n San Francisco\n </location>\n </get_weather>\n\n ===============================\n GENERAL RULES\n ===============================\n - First line: tool (function) name in angle brackets.\n - Parameters: each on their own line, in angle brackets, with name and value.\n - Include all required parameters. If info is missing, ask the user.\n - Do NOT use JSON—use only the specified XML-like format for tool calls.\n - If no call is needed, reply without a tool call.`;\n },\n});\n\n/**\n * A community-contributed middleware that uses morphXmlProtocol\n * with a more concise system prompt template for function calling.\n *\n * Originally contributed by: sijawara\n * Source: https://github.com/minpeter/ai-sdk-tool-call-middleware/issues/51#issuecomment-3234519376\n */\nexport const sijawaraConciseXmlToolMiddleware = createToolMiddleware({\n protocol: morphXmlProtocol,\n toolSystemPromptTemplate(tools: string) {\n return `You have access to callable functions (tools).\n Tool list/context:\n ${tools}\n\n STRICT CALLING RULES:\n - Use the XML-like format for tool calls:\n\n <tool_name>\n <parameter_name>\n value\n </parameter_name>\n ...\n </tool_name>\n\n - First line: the tool (function) name in angle brackets.\n - Parameters: each in their own angle brackets with name and value.\n - Include all required parameters. If info is missing, ask the user.\n - Do NOT use JSON. Use only the specified XML-like format.\n - If no call is needed, reply without a tool call.\n\n Example:\n <get_weather>\n <location>\n San Francisco\n </location>\n </get_weather>`;\n },\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/community/sijawara.ts"],"sourcesContent":["import { createToolMiddleware, morphXmlProtocol } from \"../index\";\n\n/**\n * A community-contributed middleware that uses morphXmlProtocol\n * with a more detailed system prompt template for function calling.\n *\n * Originally contributed by: sijawara\n * Source: https://github.com/minpeter/ai-sdk-tool-call-middleware/issues/51#issuecomment-3234519376\n */\nexport const sijawaraDetailedXmlToolMiddleware = createToolMiddleware({\n protocol: morphXmlProtocol,\n toolSystemPromptTemplate(tools: string) {\n return `You have access to callable functions (tools).\n Tool list/context:\n ${tools}\n\n ===============================\n TOOL CALLING FORMAT\n ===============================\n - Use the XML-like format for tool calls:\n <tool_name>\n <parameter_name>\n value\n </parameter_name>\n ...\n </tool_name>\n\n ===============================\n ARRAY PARAMETERS\n ===============================\n - For array/multiple values, repeat the parameter for each value.\n - Example:\n <send_messages>\n <recipient>\n alice@example.com\n </recipient>\n <recipient>\n bob@example.com\n </recipient>\n <message>\n Hello!\n </message>\n </send_messages>\n\n ===============================\n SINGLE VALUE PARAMETERS\n ===============================\n - For single values, use one parameter block.\n - Example:\n <get_weather>\n <location>\n San Francisco\n </location>\n </get_weather>\n\n ===============================\n GENERAL RULES\n ===============================\n - First line: tool (function) name in angle brackets.\n - Parameters: each on their own line, in angle brackets, with name and value.\n - Include all required parameters. If info is missing, ask the user.\n - Do NOT use JSON—use only the specified XML-like format for tool calls.\n - If no call is needed, reply without a tool call.`;\n },\n});\n\n/**\n * A community-contributed middleware that uses morphXmlProtocol\n * with a more concise system prompt template for function calling.\n *\n * Originally contributed by: sijawara\n * Source: https://github.com/minpeter/ai-sdk-tool-call-middleware/issues/51#issuecomment-3234519376\n */\nexport const sijawaraConciseXmlToolMiddleware = createToolMiddleware({\n protocol: morphXmlProtocol,\n toolSystemPromptTemplate(tools: string) {\n return `You have access to callable functions (tools).\n Tool list/context:\n ${tools}\n\n STRICT CALLING RULES:\n - Use the XML-like format for tool calls:\n\n <tool_name>\n <parameter_name>\n value\n </parameter_name>\n ...\n </tool_name>\n\n - First line: the tool (function) name in angle brackets.\n - Parameters: each in their own angle brackets with name and value.\n - Include all required parameters. If info is missing, ask the user.\n - Do NOT use JSON. Use only the specified XML-like format.\n - If no call is needed, reply without a tool call.\n\n Example:\n <get_weather>\n <location>\n San Francisco\n </location>\n </get_weather>`;\n },\n});\n"],"mappings":";;;;;;;;;AASO,IAAM,oCAAoC,qBAAqB;AAAA,EACpE,UAAU;AAAA,EACV,yBAAyB,OAAe;AACtC,WAAO;AAAA;AAAA,MAEL,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiDT;AACF,CAAC;AASM,IAAM,mCAAmC,qBAAqB;AAAA,EACnE,UAAU;AAAA,EACV,yBAAyB,OAAe;AACtC,WAAO;AAAA;AAAA,MAEL,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBT;AACF,CAAC;","names":[]}
|