/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AgentReasoningConfiguration, AgentReasoningConfiguration$inboundSchema, AgentReasoningConfiguration$Outbound, AgentReasoningConfiguration$outboundSchema, } from "./agentreasoningconfiguration.js"; import { AgentTextConfiguration, AgentTextConfiguration$inboundSchema, AgentTextConfiguration$Outbound, AgentTextConfiguration$outboundSchema, } from "./agenttextconfiguration.js"; import { ToolDefinition, ToolDefinition$inboundSchema, ToolDefinition$Outbound, ToolDefinition$outboundSchema, } from "./tooldefinition.js"; export type UpdateAgentRequest = { name?: string | undefined; description?: string | null | undefined; model?: string | undefined; instructions?: string | null | undefined; tools?: Array | undefined; /** * Arbitrary JSON value. */ toolChoice?: any | undefined; parallelToolCalls?: boolean | undefined; maxToolCalls?: number | null | undefined; text?: AgentTextConfiguration | null | undefined; reasoning?: AgentReasoningConfiguration | null | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateAgentRequest$inboundSchema: z.ZodType< UpdateAgentRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), description: z.nullable(z.string()).optional(), model: z.string().optional(), instructions: z.nullable(z.string()).optional(), tools: z.array(ToolDefinition$inboundSchema).optional(), tool_choice: z.any().optional(), parallel_tool_calls: z.boolean().optional(), max_tool_calls: z.nullable(z.number().int()).optional(), text: z.nullable(AgentTextConfiguration$inboundSchema).optional(), reasoning: z.nullable(AgentReasoningConfiguration$inboundSchema).optional(), metadata: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { "tool_choice": "toolChoice", "parallel_tool_calls": "parallelToolCalls", "max_tool_calls": "maxToolCalls", }); }); /** @internal */ export type UpdateAgentRequest$Outbound = { name?: string | undefined; description?: string | null | undefined; model?: string | undefined; instructions?: string | null | undefined; tools?: Array | undefined; tool_choice?: any | undefined; parallel_tool_calls?: boolean | undefined; max_tool_calls?: number | null | undefined; text?: AgentTextConfiguration$Outbound | null | undefined; reasoning?: AgentReasoningConfiguration$Outbound | null | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateAgentRequest$outboundSchema: z.ZodType< UpdateAgentRequest$Outbound, z.ZodTypeDef, UpdateAgentRequest > = z.object({ name: z.string().optional(), description: z.nullable(z.string()).optional(), model: z.string().optional(), instructions: z.nullable(z.string()).optional(), tools: z.array(ToolDefinition$outboundSchema).optional(), toolChoice: z.any().optional(), parallelToolCalls: z.boolean().optional(), maxToolCalls: z.nullable(z.number().int()).optional(), text: z.nullable(AgentTextConfiguration$outboundSchema).optional(), reasoning: z.nullable(AgentReasoningConfiguration$outboundSchema).optional(), metadata: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { toolChoice: "tool_choice", parallelToolCalls: "parallel_tool_calls", maxToolCalls: "max_tool_calls", }); }); export function updateAgentRequestToJSON( updateAgentRequest: UpdateAgentRequest, ): string { return JSON.stringify( UpdateAgentRequest$outboundSchema.parse(updateAgentRequest), ); } export function updateAgentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateAgentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateAgentRequest' from JSON`, ); }