feat: enhance agent schema with per-tool options for configuration

- Added `tool_options` schema to support per-tool configurations, including `defer_loading` and `allowed_callers`.
- Updated agent data model to incorporate new tool options, ensuring flexibility in tool behavior management.
- Modified type definitions to reflect the new `tool_options` structure for agents.
This commit is contained in:
Danny Avila 2026-01-07 21:14:21 -05:00
parent 4682f0e370
commit 2d4833b49e
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
3 changed files with 18 additions and 1 deletions

View file

@ -51,6 +51,15 @@ export const graphEdgeSchema = z.object({
promptKey: z.string().optional(),
});
/** Per-tool options schema (defer_loading, allowed_callers) */
export const toolOptionsSchema = z.object({
defer_loading: z.boolean().optional(),
allowed_callers: z.array(z.enum(['direct', 'code_execution'])).optional(),
});
/** Agent tool options - map of tool_id to tool options */
export const agentToolOptionsSchema = z.record(z.string(), toolOptionsSchema).optional();
/** Base agent schema with all common fields */
export const agentBaseSchema = z.object({
name: z.string().nullable().optional(),
@ -68,6 +77,7 @@ export const agentBaseSchema = z.object({
recursion_limit: z.number().optional(),
conversation_starters: z.array(z.string()).optional(),
tool_resources: agentToolResourcesSchema,
tool_options: agentToolOptionsSchema,
support_contact: agentSupportContactSchema,
category: z.string().optional(),
});