/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 28ea4b4db277
 */
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 AgentsCompletionStreamRequestStop$outboundSchema = smartUnion([z.string(), z.array(z.string())]);
export function agentsCompletionStreamRequestStopToJSON(agentsCompletionStreamRequestStop) {
    return JSON.stringify(AgentsCompletionStreamRequestStop$outboundSchema.parse(agentsCompletionStreamRequestStop));
}
/** @internal */
export const AgentsCompletionStreamRequestMessage$outboundSchema = z.union([
    AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") })),
    SystemMessage$outboundSchema,
    ToolMessage$outboundSchema,
    UserMessage$outboundSchema,
]);
export function agentsCompletionStreamRequestMessageToJSON(agentsCompletionStreamRequestMessage) {
    return JSON.stringify(AgentsCompletionStreamRequestMessage$outboundSchema.parse(agentsCompletionStreamRequestMessage));
}
/** @internal */
export const AgentsCompletionStreamRequestTool$outboundSchema = z.union([
    Tool$outboundSchema,
    WebSearchTool$outboundSchema,
    WebSearchPremiumTool$outboundSchema,
    CodeInterpreterTool$outboundSchema,
    ImageGenerationTool$outboundSchema,
    DocumentLibraryTool$outboundSchema,
    CustomConnector$outboundSchema,
]);
export function agentsCompletionStreamRequestToolToJSON(agentsCompletionStreamRequestTool) {
    return JSON.stringify(AgentsCompletionStreamRequestTool$outboundSchema.parse(agentsCompletionStreamRequestTool));
}
/** @internal */
export const AgentsCompletionStreamRequestToolChoice$outboundSchema = smartUnion([ToolChoice$outboundSchema, ToolChoiceEnum$outboundSchema]);
export function agentsCompletionStreamRequestToolChoiceToJSON(agentsCompletionStreamRequestToolChoice) {
    return JSON.stringify(AgentsCompletionStreamRequestToolChoice$outboundSchema.parse(agentsCompletionStreamRequestToolChoice));
}
/** @internal */
export const AgentsCompletionStreamRequest$outboundSchema = z.object({
    maxTokens: z.nullable(z.int()).optional(),
    stream: z.boolean().default(true),
    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 agentsCompletionStreamRequestToJSON(agentsCompletionStreamRequest) {
    return JSON.stringify(AgentsCompletionStreamRequest$outboundSchema.parse(agentsCompletionStreamRequest));
}
//# sourceMappingURL=agentscompletionstreamrequest.js.map