@sdk-it/typescript 0.36.0 → 0.36.1
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/index.js +3 -16
- package/dist/index.js.map +2 -2
- package/dist/lib/agent/ai-sdk.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -56,18 +56,13 @@ function generateAISDKTools(ir) {
|
|
|
56
56
|
}`;
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
|
-
|
|
60
|
-
name: 'Triage Agent',
|
|
61
|
-
tools:{${Object.entries(groups).map(([, { name }]) => {
|
|
62
|
-
return createTransferTool(name);
|
|
63
|
-
})}}}`;
|
|
64
|
-
return [...imports, ...agent, handoffs].join("\n\n");
|
|
59
|
+
return [...imports, ...agent].join("\n\n");
|
|
65
60
|
}
|
|
66
61
|
function createTool(entry, operation) {
|
|
67
62
|
const schemaName = camelcase(`${operation.operationId} schema`);
|
|
68
63
|
const toolInfo = operation["x-tool"];
|
|
69
|
-
return `'${toolInfo
|
|
70
|
-
description: \`${toolInfo.description}\`,
|
|
64
|
+
return `'${toolInfo?.name || operation["x-fn-name"]}': tool({
|
|
65
|
+
description: \`${toolInfo?.description || operation.description || operation.summary}\`,
|
|
71
66
|
inputSchema: schemas.${schemaName},
|
|
72
67
|
execute: async (input, options) => {
|
|
73
68
|
console.log('Executing ${operation.operationId} tool with input:', input);
|
|
@@ -80,14 +75,6 @@ function createTool(entry, operation) {
|
|
|
80
75
|
},
|
|
81
76
|
})`;
|
|
82
77
|
}
|
|
83
|
-
function createTransferTool(agentName) {
|
|
84
|
-
return `transfer_to_${agentName}: tool({
|
|
85
|
-
type: 'function',
|
|
86
|
-
description: 'Transfer the conversation to the ${agentName}.',
|
|
87
|
-
inputSchema: z.object({}),
|
|
88
|
-
execute: async () => ({ agent: '${agentName}' }),
|
|
89
|
-
})`;
|
|
90
|
-
}
|
|
91
78
|
|
|
92
79
|
// packages/typescript/src/lib/agent/openai-agents.ts
|
|
93
80
|
import { camelcase as camelcase2, spinalcase } from "stringcase";
|