AgentMark provides robust type safety through JSON Schema definitions in your prompt files. This ensures type checking for both inputs and outputs, making your prompts more reliable and maintainable.
You can define both input and output types in your prompt files using JSON Schema:
math-addition.prompt.mdx
Copy
---name: math-additionobject_config: model_name: gpt-4o schema: # Output type definition type: "object" properties: sum: type: "number" description: "The sum of the two numbers" required: ["sum"]input_schema: # Input type definition type: "object" properties: num1: type: "number" description: "First number to add" num2: type: "number" description: "Second number to add" required: ["num1", "num2"]---<System>You are a helpful math assistant that performs addition.</System><User>What is the sum of {props.num1} and {props.num2}?</User>
agentmark.types.ts
Copy
// Auto-generated types from Agentmark// Do not edit this file directlytype SumArgs = { num1: number; num2: number };export interface Tools { sum: { args: SumArgs };}interface Math$AdditionIn { /** First number to add */ num1: number; /** Second number to add */ num2: number;}interface Math$AdditionOut { /** The sum of the two numbers */ sum: number; /** Step by step explanation */ explanation: string;}interface Math$Addition { input: Math$AdditionIn; output: Math$AdditionOut; kind: "object"}export default interface AgentmarkTypes { "math/addition.prompt.mdx": Math$Addition}