/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: c88ac13bb48c
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { smartUnion } from "../../types/smartUnion.js";
import { AssistantMessage$outboundSchema, } from "./assistantmessage.js";
import { CodeInterpreterTool$outboundSchema, } from "./codeinterpretertool.js";
import { CustomConnector$outboundSchema, } from "./customconnector.js";
import { DocumentLibraryTool$outboundSchema, } from "./documentlibrarytool.js";
import { GuardrailConfig$outboundSchema, } from "./guardrailconfig.js";
import { ImageGenerationTool$outboundSchema, } from "./imagegenerationtool.js";
import { MistralPromptMode$outboundSchema, } from "./mistralpromptmode.js";
import { Prediction$outboundSchema, } from "./prediction.js";
import { ReasoningEffort$outboundSchema, } from "./reasoningeffort.js";
import { ResponseFormat$outboundSchema, } from "./responseformat.js";
import { SystemMessage$outboundSchema, } from "./systemmessage.js";
import { Tool$outboundSchema } from "./tool.js";
import { ToolChoice$outboundSchema, } from "./toolchoice.js";
import { ToolChoiceEnum$outboundSchema, } from "./toolchoiceenum.js";
import { ToolMessage$outboundSchema, } from "./toolmessage.js";
import { UserMessage$outboundSchema, } from "./usermessage.js";
import { WebSearchPremiumTool$outboundSchema, } from "./websearchpremiumtool.js";
import { WebSearchTool$outboundSchema, } from "./websearchtool.js";
/** @internal */
export const AgentsCompletionRequestStop$outboundSchema = smartUnion([z.string(), z.array(z.string())]);
export function agentsCompletionRequestStopToJSON(agentsCompletionRequestStop) {
    return JSON.stringify(AgentsCompletionRequestStop$outboundSchema.parse(agentsCompletionRequestStop));
}
/** @internal */
export const AgentsCompletionRequestMessage$outboundSchema = z.union([
    AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") })),
    SystemMessage$outboundSchema,
    ToolMessage$outboundSchema,
    UserMessage$outboundSchema,
]);
export function agentsCompletionRequestMessageToJSON(agentsCompletionRequestMessage) {
    return JSON.stringify(AgentsCompletionRequestMessage$outboundSchema.parse(agentsCompletionRequestMessage));
}
/** @internal */
export const AgentsCompletionRequestTool$outboundSchema = z.union([
    Tool$outboundSchema,
    WebSearchTool$outboundSchema,
    WebSearchPremiumTool$outboundSchema,
    CodeInterpreterTool$outboundSchema,
    ImageGenerationTool$outboundSchema,
    DocumentLibraryTool$outboundSchema,
    CustomConnector$outboundSchema,
]);
export function agentsCompletionRequestToolToJSON(agentsCompletionRequestTool) {
    return JSON.stringify(AgentsCompletionRequestTool$outboundSchema.parse(agentsCompletionRequestTool));
}
/** @internal */
export const AgentsCompletionRequestToolChoice$outboundSchema = smartUnion([ToolChoice$outboundSchema, ToolChoiceEnum$outboundSchema]);
export function agentsCompletionRequestToolChoiceToJSON(agentsCompletionRequestToolChoice) {
    return JSON.stringify(AgentsCompletionRequestToolChoice$outboundSchema.parse(agentsCompletionRequestToolChoice));
}
/** @internal */
export const AgentsCompletionRequest$outboundSchema = z.object({
    maxTokens: z.nullable(z.int()).optional(),
    stream: z.boolean().default(false),
    stop: z.nullable(smartUnion([z.string(), z.array(z.string())])).optional(),
    randomSeed: z.nullable(z.int()).optional(),
    metadata: z.nullable(z.record(z.string(), z.any())).optional(),
    messages: z.array(z.union([
        AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") })),
        SystemMessage$outboundSchema,
        ToolMessage$outboundSchema,
        UserMessage$outboundSchema,
    ])),
    responseFormat: ResponseFormat$outboundSchema.optional(),
    tools: z.nullable(z.array(z.union([
        Tool$outboundSchema,
        WebSearchTool$outboundSchema,
        WebSearchPremiumTool$outboundSchema,
        CodeInterpreterTool$outboundSchema,
        ImageGenerationTool$outboundSchema,
        DocumentLibraryTool$outboundSchema,
        CustomConnector$outboundSchema,
    ]))).optional(),
    toolChoice: smartUnion([
        ToolChoice$outboundSchema,
        ToolChoiceEnum$outboundSchema,
    ]).optional(),
    presencePenalty: z.nullable(z.number()).optional(),
    frequencyPenalty: z.nullable(z.number()).optional(),
    n: z.nullable(z.int()).optional(),
    prediction: Prediction$outboundSchema.optional(),
    parallelToolCalls: z.boolean().optional(),
    reasoningEffort: z.nullable(ReasoningEffort$outboundSchema).optional(),
    promptMode: z.nullable(MistralPromptMode$outboundSchema).optional(),
    guardrails: z.nullable(z.array(GuardrailConfig$outboundSchema)).optional(),
    promptCacheKey: z.nullable(z.string()).optional(),
    agentId: z.string(),
}).transform((v) => {
    return remap$(v, {
        maxTokens: "max_tokens",
        randomSeed: "random_seed",
        responseFormat: "response_format",
        toolChoice: "tool_choice",
        presencePenalty: "presence_penalty",
        frequencyPenalty: "frequency_penalty",
        parallelToolCalls: "parallel_tool_calls",
        reasoningEffort: "reasoning_effort",
        promptMode: "prompt_mode",
        promptCacheKey: "prompt_cache_key",
        agentId: "agent_id",
    });
});
export function agentsCompletionRequestToJSON(agentsCompletionRequest) {
    return JSON.stringify(AgentsCompletionRequest$outboundSchema.parse(agentsCompletionRequest));
}
//# sourceMappingURL=agentscompletionrequest.js.map