Manage Zod Schema for Tool Calling
Langtrace lets you store and version Zod schemas for tool calling, making it easy to manage and reuse them across your applications.
How to create and version prompts
Step 1: Create a new project in Langtrace and go to the Prompts tab. Click on the “Create Prompt” button to create a new prompt.
Step 2: Paste the Zod schema in the “Prompt” field. You can define the schema for the tool calling in the Zod format. This schema will be automatically converted to JSON schema which is accepted by the OpenAI spec for tool calling.
Step 2: Once you have created a prompt, you can make it available by clicking the “Go Live” button. This will make the prompt available for use in your applications by default when you fetch it using the SDK. When fetched, the schema will be converted to JSON schema and can be directly used for tool calling.
Step 3: Use the prompt in your application by fetching it using the SDK.
Step 4: You can also fetch a specific version of the prompt by passing the version number in the options. And you can get the “Prompt Registry ID” from the Langtrace UI.
That’s it! You have successfully created and versioned a zod schema in Langtrace. You can now use this schema in your applications and easily manage and reuse it across your projects.