mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-17 16:05:32 +01:00
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:
parent
4682f0e370
commit
2d4833b49e
3 changed files with 18 additions and 1 deletions
|
|
@ -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(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue