/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 36834e0e0bfa
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
import { CodeInterpreterTool$inboundSchema, } from "./codeinterpretertool.js";
import { CompletionArgs$inboundSchema, } from "./completionargs.js";
import { CustomConnector$inboundSchema, } from "./customconnector.js";
import { DocumentLibraryTool$inboundSchema, } from "./documentlibrarytool.js";
import { FunctionTool$inboundSchema } from "./functiontool.js";
import { GuardrailConfig$inboundSchema, } from "./guardrailconfig.js";
import { ImageGenerationTool$inboundSchema, } from "./imagegenerationtool.js";
import { WebSearchPremiumTool$inboundSchema, } from "./websearchpremiumtool.js";
import { WebSearchTool$inboundSchema } from "./websearchtool.js";
/** @internal */
export const AgentTool$inboundSchema = discriminatedUnion("type", {
    code_interpreter: CodeInterpreterTool$inboundSchema,
    connector: CustomConnector$inboundSchema,
    document_library: DocumentLibraryTool$inboundSchema,
    function: FunctionTool$inboundSchema,
    image_generation: ImageGenerationTool$inboundSchema,
    web_search: WebSearchTool$inboundSchema,
    web_search_premium: WebSearchPremiumTool$inboundSchema,
});
export function agentToolFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AgentTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentTool' from JSON`);
}
/** @internal */
export const Agent$inboundSchema = z.object({
    instructions: z.nullable(z.string()).optional(),
    tools: z.array(discriminatedUnion("type", {
        code_interpreter: CodeInterpreterTool$inboundSchema,
        connector: CustomConnector$inboundSchema,
        document_library: DocumentLibraryTool$inboundSchema,
        function: FunctionTool$inboundSchema,
        image_generation: ImageGenerationTool$inboundSchema,
        web_search: WebSearchTool$inboundSchema,
        web_search_premium: WebSearchPremiumTool$inboundSchema,
    })).optional(),
    completion_args: CompletionArgs$inboundSchema.optional(),
    guardrails: z.nullable(z.array(GuardrailConfig$inboundSchema)).optional(),
    model: z.string(),
    name: z.string(),
    description: z.nullable(z.string()).optional(),
    handoffs: z.nullable(z.array(z.string())).optional(),
    metadata: z.nullable(z.record(z.string(), z.any())).optional(),
    object: z.literal("agent").default("agent"),
    id: z.string(),
    version: z.int(),
    versions: z.array(z.int()),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    updated_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    deployment_chat: z.boolean(),
    source: z.string(),
    version_message: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        "completion_args": "completionArgs",
        "created_at": "createdAt",
        "updated_at": "updatedAt",
        "deployment_chat": "deploymentChat",
        "version_message": "versionMessage",
    });
});
export function agentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Agent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Agent' from JSON`);
}
//# sourceMappingURL=agent.js.map