tinyagent-ts
Version:
Modern TypeScript framework for building AI agents with pluggable tools and ReAct reasoning
19 lines • 816 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AssistantReplySchema = exports.FinalAnswerCallSchema = exports.ToolCallSchema = void 0;
const zod_1 = require("zod");
exports.ToolCallSchema = zod_1.z.object({
tool: zod_1.z.string().min(1),
args: zod_1.z.record(zod_1.z.any()),
}).strict();
// Specific validation for the built-in final_answer tool
exports.FinalAnswerCallSchema = zod_1.z
.object({
tool: zod_1.z.literal('final_answer'),
args: zod_1.z.object({ answer: zod_1.z.string() }),
})
.strict();
// All assistant replies must be well‑formed tool calls. Direct answers must be
// returned via the `final_answer` tool rather than a standalone `answer` field.
exports.AssistantReplySchema = exports.ToolCallSchema;
//# sourceMappingURL=schemas.js.map