"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateRouterResponseResponse$inboundSchema = exports.CreateRouterResponseResponseBody$inboundSchema = exports.Truncation$inboundSchema = exports.CreateRouterResponseStatus$inboundSchema = exports.ServiceTier$inboundSchema = exports.CreateRouterResponseResponsesResponseBody$inboundSchema = exports.CreateRouterResponseRequestBody$outboundSchema = exports.CreateRouterResponseTools$outboundSchema = exports.ToolsFunction$outboundSchema = exports.OrqAiTool$outboundSchema = exports.CreateRouterResponseToolsType$outboundSchema = exports.ToolsMCPTool$outboundSchema = exports.AllowedTools$outboundSchema = exports.CreateRouterResponseToolChoice$outboundSchema = exports.Shorthand$outboundSchema = exports.SpecificFunction$outboundSchema = exports.CreateRouterResponseToolChoiceType$outboundSchema = exports.CreateRouterResponseText$outboundSchema = exports.Verbosity$outboundSchema = exports.CreateRouterResponseFormat$outboundSchema = exports.PlainText$outboundSchema = exports.FormatJSONSchema$outboundSchema = exports.FormatSchema$outboundSchema = exports.TemplateEngine$outboundSchema = exports.CreateRouterResponseInput$outboundSchema = exports.CreateRouterResponseInput2$outboundSchema = exports.InputType$outboundSchema = exports.InputRole$outboundSchema = exports.InputContent$outboundSchema = exports.CreateRouterResponseContent2$outboundSchema = exports.TwoText$outboundSchema = exports.Image$outboundSchema = exports.Detail$outboundSchema = exports.TwoFile$outboundSchema = exports.Truncation = exports.CreateRouterResponseStatus = exports.ServiceTier = exports.CreateRouterResponseToolsType = exports.Shorthand = exports.CreateRouterResponseToolChoiceType = exports.Verbosity = exports.TemplateEngine = exports.InputType = exports.InputRole = exports.Detail = void 0;
exports.twoFileToJSON = twoFileToJSON;
exports.imageToJSON = imageToJSON;
exports.twoTextToJSON = twoTextToJSON;
exports.createRouterResponseContent2ToJSON = createRouterResponseContent2ToJSON;
exports.inputContentToJSON = inputContentToJSON;
exports.createRouterResponseInput2ToJSON = createRouterResponseInput2ToJSON;
exports.createRouterResponseInputToJSON = createRouterResponseInputToJSON;
exports.formatSchemaToJSON = formatSchemaToJSON;
exports.formatJSONSchemaToJSON = formatJSONSchemaToJSON;
exports.plainTextToJSON = plainTextToJSON;
exports.createRouterResponseFormatToJSON = createRouterResponseFormatToJSON;
exports.createRouterResponseTextToJSON = createRouterResponseTextToJSON;
exports.specificFunctionToJSON = specificFunctionToJSON;
exports.createRouterResponseToolChoiceToJSON = createRouterResponseToolChoiceToJSON;
exports.allowedToolsToJSON = allowedToolsToJSON;
exports.toolsMCPToolToJSON = toolsMCPToolToJSON;
exports.orqAiToolToJSON = orqAiToolToJSON;
exports.toolsFunctionToJSON = toolsFunctionToJSON;
exports.createRouterResponseToolsToJSON = createRouterResponseToolsToJSON;
exports.createRouterResponseRequestBodyToJSON = createRouterResponseRequestBodyToJSON;
exports.createRouterResponseResponsesResponseBodyFromJSON = createRouterResponseResponsesResponseBodyFromJSON;
exports.createRouterResponseResponseBodyFromJSON = createRouterResponseResponseBodyFromJSON;
exports.createRouterResponseResponseFromJSON = createRouterResponseResponseFromJSON;
const z = __importStar(require("zod/v3"));
const event_streams_js_1 = require("../../lib/event-streams.js");
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/**
 * The detail level for image understanding.
 */
exports.Detail = {
    Auto: "auto",
    Low: "low",
    High: "high",
};
/**
 * The role of the message sender (for message items).
 */
exports.InputRole = {
    User: "user",
    Assistant: "assistant",
    System: "system",
    Developer: "developer",
};
/**
 * The type of item.
 */
exports.InputType = {
    Message: "message",
    FunctionCallOutput: "function_call_output",
    ItemReference: "item_reference",
};
/**
 * Template engine for variable substitution in instructions. Defaults to the agent manifest's engine when invoking an agent, otherwise text.
 */
exports.TemplateEngine = {
    Text: "text",
    Jinja: "jinja",
    Mustache: "mustache",
};
exports.Verbosity = {
    Low: "low",
    Medium: "medium",
    High: "high",
};
exports.CreateRouterResponseToolChoiceType = {
    Function: "function",
};
/**
 * Shorthand: "auto" lets the model decide, "none" disables tools, "required" forces tool use.
 */
exports.Shorthand = {
    Auto: "auto",
    None: "none",
    Required: "required",
};
/**
 * The orq.ai tool type.
 */
exports.CreateRouterResponseToolsType = {
    OrqCurrentDate: "orq:current_date",
    OrqGoogleSearch: "orq:google_search",
    OrqWebScraper: "orq:web_scraper",
    OrqMcp: "orq:mcp",
    OrqHttp: "orq:http",
    OrqFunction: "orq:function",
};
exports.ServiceTier = {
    Auto: "auto",
    Default: "default",
    Flex: "flex",
    Priority: "priority",
};
exports.CreateRouterResponseStatus = {
    Queued: "queued",
    InProgress: "in_progress",
    Completed: "completed",
    Failed: "failed",
    Incomplete: "incomplete",
    RequiresAction: "requires_action",
};
exports.Truncation = {
    Disabled: "disabled",
    Auto: "auto",
};
/** @internal */
exports.TwoFile$outboundSchema = z.object({
    fileData: z.string().optional(),
    fileId: z.string().optional(),
    fileUrl: z.string().optional(),
    filename: z.string().optional(),
    mimeType: z.string().optional(),
    type: z.literal("input_file"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        fileData: "file_data",
        fileId: "file_id",
        fileUrl: "file_url",
        mimeType: "mime_type",
    });
});
function twoFileToJSON(twoFile) {
    return JSON.stringify(exports.TwoFile$outboundSchema.parse(twoFile));
}
/** @internal */
exports.Detail$outboundSchema = z
    .nativeEnum(exports.Detail);
/** @internal */
exports.Image$outboundSchema = z.object({
    detail: exports.Detail$outboundSchema.optional(),
    fileId: z.string().optional(),
    imageUrl: z.string().optional(),
    type: z.literal("input_image"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        fileId: "file_id",
        imageUrl: "image_url",
    });
});
function imageToJSON(image) {
    return JSON.stringify(exports.Image$outboundSchema.parse(image));
}
/** @internal */
exports.TwoText$outboundSchema = z.object({
    text: z.string(),
    type: z.literal("input_text"),
});
function twoTextToJSON(twoText) {
    return JSON.stringify(exports.TwoText$outboundSchema.parse(twoText));
}
/** @internal */
exports.CreateRouterResponseContent2$outboundSchema = z.union([
    z.lazy(() => exports.TwoText$outboundSchema),
    z.lazy(() => exports.Image$outboundSchema),
    z.lazy(() => exports.TwoFile$outboundSchema),
]);
function createRouterResponseContent2ToJSON(createRouterResponseContent2) {
    return JSON.stringify(exports.CreateRouterResponseContent2$outboundSchema.parse(createRouterResponseContent2));
}
/** @internal */
exports.InputContent$outboundSchema = z.union([
    z.string(),
    z.array(z.union([
        z.lazy(() => exports.TwoText$outboundSchema),
        z.lazy(() => exports.Image$outboundSchema),
        z.lazy(() => exports.TwoFile$outboundSchema),
    ])),
]);
function inputContentToJSON(inputContent) {
    return JSON.stringify(exports.InputContent$outboundSchema.parse(inputContent));
}
/** @internal */
exports.InputRole$outboundSchema = z
    .nativeEnum(exports.InputRole);
/** @internal */
exports.InputType$outboundSchema = z
    .nativeEnum(exports.InputType);
/** @internal */
exports.CreateRouterResponseInput2$outboundSchema = z.object({
    callId: z.string().optional(),
    content: z.union([
        z.string(),
        z.array(z.union([
            z.lazy(() => exports.TwoText$outboundSchema),
            z.lazy(() => exports.Image$outboundSchema),
            z.lazy(() => exports.TwoFile$outboundSchema),
        ])),
    ]).optional(),
    id: z.string().optional(),
    output: z.string().optional(),
    role: exports.InputRole$outboundSchema.optional(),
    type: exports.InputType$outboundSchema.optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callId: "call_id",
    });
});
function createRouterResponseInput2ToJSON(createRouterResponseInput2) {
    return JSON.stringify(exports.CreateRouterResponseInput2$outboundSchema.parse(createRouterResponseInput2));
}
/** @internal */
exports.CreateRouterResponseInput$outboundSchema = z.union([
    z.string(),
    z.array(z.lazy(() => exports.CreateRouterResponseInput2$outboundSchema)),
]);
function createRouterResponseInputToJSON(createRouterResponseInput) {
    return JSON.stringify(exports.CreateRouterResponseInput$outboundSchema.parse(createRouterResponseInput));
}
/** @internal */
exports.TemplateEngine$outboundSchema = z.nativeEnum(exports.TemplateEngine);
/** @internal */
exports.FormatSchema$outboundSchema = z.object({});
function formatSchemaToJSON(formatSchema) {
    return JSON.stringify(exports.FormatSchema$outboundSchema.parse(formatSchema));
}
/** @internal */
exports.FormatJSONSchema$outboundSchema = z.object({
    description: z.string().optional(),
    name: z.string().optional(),
    schema: z.lazy(() => exports.FormatSchema$outboundSchema).optional(),
    strict: z.boolean().optional(),
    type: z.literal("json_schema"),
});
function formatJSONSchemaToJSON(formatJSONSchema) {
    return JSON.stringify(exports.FormatJSONSchema$outboundSchema.parse(formatJSONSchema));
}
/** @internal */
exports.PlainText$outboundSchema = z.object({
    type: z.literal("text"),
});
function plainTextToJSON(plainText) {
    return JSON.stringify(exports.PlainText$outboundSchema.parse(plainText));
}
/** @internal */
exports.CreateRouterResponseFormat$outboundSchema = z.union([
    z.lazy(() => exports.PlainText$outboundSchema),
    z.lazy(() => exports.FormatJSONSchema$outboundSchema),
]);
function createRouterResponseFormatToJSON(createRouterResponseFormat) {
    return JSON.stringify(exports.CreateRouterResponseFormat$outboundSchema.parse(createRouterResponseFormat));
}
/** @internal */
exports.Verbosity$outboundSchema = z
    .nativeEnum(exports.Verbosity);
/** @internal */
exports.CreateRouterResponseText$outboundSchema = z.object({
    format: z.union([
        z.lazy(() => exports.PlainText$outboundSchema),
        z.lazy(() => exports.FormatJSONSchema$outboundSchema),
    ]).optional(),
    verbosity: exports.Verbosity$outboundSchema.optional(),
});
function createRouterResponseTextToJSON(createRouterResponseText) {
    return JSON.stringify(exports.CreateRouterResponseText$outboundSchema.parse(createRouterResponseText));
}
/** @internal */
exports.CreateRouterResponseToolChoiceType$outboundSchema = z.nativeEnum(exports.CreateRouterResponseToolChoiceType);
/** @internal */
exports.SpecificFunction$outboundSchema = z.object({
    name: z.string(),
    type: exports.CreateRouterResponseToolChoiceType$outboundSchema,
});
function specificFunctionToJSON(specificFunction) {
    return JSON.stringify(exports.SpecificFunction$outboundSchema.parse(specificFunction));
}
/** @internal */
exports.Shorthand$outboundSchema = z
    .nativeEnum(exports.Shorthand);
/** @internal */
exports.CreateRouterResponseToolChoice$outboundSchema = z.union([
    z.lazy(() => exports.SpecificFunction$outboundSchema),
    exports.Shorthand$outboundSchema,
]);
function createRouterResponseToolChoiceToJSON(createRouterResponseToolChoice) {
    return JSON.stringify(exports.CreateRouterResponseToolChoice$outboundSchema.parse(createRouterResponseToolChoice));
}
/** @internal */
exports.AllowedTools$outboundSchema = z.object({
    readOnly: z.boolean().optional(),
    toolNames: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        readOnly: "read_only",
        toolNames: "tool_names",
    });
});
function allowedToolsToJSON(allowedTools) {
    return JSON.stringify(exports.AllowedTools$outboundSchema.parse(allowedTools));
}
/** @internal */
exports.ToolsMCPTool$outboundSchema = z.object({
    allowedTools: z.lazy(() => exports.AllowedTools$outboundSchema).optional(),
    headers: z.record(z.string()).optional(),
    key: z.string().optional(),
    serverDescription: z.string().optional(),
    serverUrl: z.string().optional(),
    type: z.literal("mcp"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        allowedTools: "allowed_tools",
        serverDescription: "server_description",
        serverUrl: "server_url",
    });
});
function toolsMCPToolToJSON(toolsMCPTool) {
    return JSON.stringify(exports.ToolsMCPTool$outboundSchema.parse(toolsMCPTool));
}
/** @internal */
exports.CreateRouterResponseToolsType$outboundSchema = z.nativeEnum(exports.CreateRouterResponseToolsType);
/** @internal */
exports.OrqAiTool$outboundSchema = z.object({
    toolId: z.string().optional(),
    type: exports.CreateRouterResponseToolsType$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolId: "tool_id",
    });
});
function orqAiToolToJSON(orqAiTool) {
    return JSON.stringify(exports.OrqAiTool$outboundSchema.parse(orqAiTool));
}
/** @internal */
exports.ToolsFunction$outboundSchema = z.object({
    description: z.string().optional(),
    name: z.string(),
    parameters: z.record(z.any()).optional(),
    strict: z.boolean().optional(),
    type: z.literal("function"),
});
function toolsFunctionToJSON(toolsFunction) {
    return JSON.stringify(exports.ToolsFunction$outboundSchema.parse(toolsFunction));
}
/** @internal */
exports.CreateRouterResponseTools$outboundSchema = z.union([
    z.lazy(() => exports.ToolsFunction$outboundSchema),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:current_date") })),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:google_search") })),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:web_scraper") })),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:mcp") })),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:http") })),
    z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:function") })),
    z.lazy(() => exports.ToolsMCPTool$outboundSchema),
]);
function createRouterResponseToolsToJSON(createRouterResponseTools) {
    return JSON.stringify(exports.CreateRouterResponseTools$outboundSchema.parse(createRouterResponseTools));
}
/** @internal */
exports.CreateRouterResponseRequestBody$outboundSchema = z.object({
    conversation: components.ConversationParam$outboundSchema.optional(),
    fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
        .optional(),
    frequencyPenalty: z.number().optional(),
    guardrails: z.array(components.EvaluatorRef$outboundSchema).optional(),
    identity: components.ResponseIdentity$outboundSchema.optional(),
    input: z.union([
        z.string(),
        z.array(z.lazy(() => exports.CreateRouterResponseInput2$outboundSchema)),
    ]).optional(),
    instructions: z.string().optional(),
    limits: components.ResponseExecutionLimits$outboundSchema.optional(),
    maxOutputTokens: z.number().int().optional(),
    maxToolCalls: z.number().int().optional(),
    memory: components.MemoryParam$outboundSchema.optional(),
    metadata: z.record(z.string()).optional(),
    model: z.string().optional(),
    parallelToolCalls: z.boolean().optional(),
    presencePenalty: z.number().optional(),
    previousResponseId: z.string().optional(),
    promptCacheKey: z.string().optional(),
    reasoning: components.ReasoningParam$outboundSchema.optional(),
    retry: components.ResponseRetryConfig$outboundSchema.optional(),
    safetyIdentifier: z.string().optional(),
    store: z.boolean().optional(),
    stream: z.boolean().optional(),
    streamOptions: components.StreamOptions$outboundSchema.optional(),
    temperature: z.number().optional(),
    templateEngine: exports.TemplateEngine$outboundSchema.optional(),
    text: z.lazy(() => exports.CreateRouterResponseText$outboundSchema).optional(),
    thread: components.ResponseThread$outboundSchema.optional(),
    toolChoice: z.union([
        z.lazy(() => exports.SpecificFunction$outboundSchema),
        exports.Shorthand$outboundSchema,
    ]).optional(),
    tools: z.array(z.union([
        z.lazy(() => exports.ToolsFunction$outboundSchema),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:current_date") })),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:google_search") })),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:web_scraper") })),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:mcp") })),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:http") })),
        z.lazy(() => exports.OrqAiTool$outboundSchema).and(z.object({ type: z.literal("orq:function") })),
        z.lazy(() => exports.ToolsMCPTool$outboundSchema),
    ])).optional(),
    topLogprobs: z.number().int().optional(),
    topP: z.number().optional(),
    variables: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        frequencyPenalty: "frequency_penalty",
        maxOutputTokens: "max_output_tokens",
        maxToolCalls: "max_tool_calls",
        parallelToolCalls: "parallel_tool_calls",
        presencePenalty: "presence_penalty",
        previousResponseId: "previous_response_id",
        promptCacheKey: "prompt_cache_key",
        safetyIdentifier: "safety_identifier",
        streamOptions: "stream_options",
        templateEngine: "template_engine",
        toolChoice: "tool_choice",
        topLogprobs: "top_logprobs",
        topP: "top_p",
    });
});
function createRouterResponseRequestBodyToJSON(createRouterResponseRequestBody) {
    return JSON.stringify(exports.CreateRouterResponseRequestBody$outboundSchema.parse(createRouterResponseRequestBody));
}
/** @internal */
exports.CreateRouterResponseResponsesResponseBody$inboundSchema = z.object({
    data: z.unknown().optional().transform((v, ctx) => {
        if (v === undefined)
            return undefined;
        if (typeof v !== "string")
            return v;
        try {
            return JSON.parse(v);
        }
        catch (err) {
            ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
            return z.NEVER;
        }
    }).pipe(components.ResponseStreamEvent$inboundSchema.optional()),
});
function createRouterResponseResponsesResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateRouterResponseResponsesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateRouterResponseResponsesResponseBody' from JSON`);
}
/** @internal */
exports.ServiceTier$inboundSchema = z
    .nativeEnum(exports.ServiceTier);
/** @internal */
exports.CreateRouterResponseStatus$inboundSchema = z.nativeEnum(exports.CreateRouterResponseStatus);
/** @internal */
exports.Truncation$inboundSchema = z
    .nativeEnum(exports.Truncation);
/** @internal */
exports.CreateRouterResponseResponseBody$inboundSchema = z.object({
    background: z.boolean(),
    completed_at: z.nullable(z.number().int()),
    conversation: components.ConversationParam$inboundSchema.optional(),
    created_at: z.number().int(),
    error: z.nullable(components.ResponseError$inboundSchema),
    frequency_penalty: z.number(),
    id: z.string(),
    incomplete_details: z.nullable(components.IncompleteDetails$inboundSchema),
    input: z.nullable(z.array(z.any())),
    instructions: z.nullable(z.string()),
    max_output_tokens: z.nullable(z.number().int()),
    max_tool_calls: z.nullable(z.number().int()),
    memory: components.MemoryParam$inboundSchema.optional(),
    metadata: z.record(z.string()),
    model: z.string(),
    object: z.string(),
    output: z.nullable(z.array(z.any())),
    parallel_tool_calls: z.boolean(),
    presence_penalty: z.number(),
    previous_response_id: z.nullable(z.string()),
    prompt_cache_key: z.nullable(z.string()),
    prompt_cache_retention: z.nullable(z.string()),
    reasoning: z.nullable(components.Reasoning$inboundSchema),
    safety_identifier: z.nullable(z.string()),
    service_tier: exports.ServiceTier$inboundSchema,
    status: exports.CreateRouterResponseStatus$inboundSchema,
    store: z.boolean(),
    temperature: z.number(),
    text: z.any().optional(),
    tool_choice: z.any().optional(),
    tools: z.nullable(z.array(z.any())),
    top_logprobs: z.number().int(),
    top_p: z.number(),
    truncation: exports.Truncation$inboundSchema,
    usage: components.PublicUsage$inboundSchema,
    user: z.nullable(z.string()),
    variables: z.record(z.any()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "completed_at": "completedAt",
        "created_at": "createdAt",
        "frequency_penalty": "frequencyPenalty",
        "incomplete_details": "incompleteDetails",
        "max_output_tokens": "maxOutputTokens",
        "max_tool_calls": "maxToolCalls",
        "parallel_tool_calls": "parallelToolCalls",
        "presence_penalty": "presencePenalty",
        "previous_response_id": "previousResponseId",
        "prompt_cache_key": "promptCacheKey",
        "prompt_cache_retention": "promptCacheRetention",
        "safety_identifier": "safetyIdentifier",
        "service_tier": "serviceTier",
        "tool_choice": "toolChoice",
        "top_logprobs": "topLogprobs",
        "top_p": "topP",
    });
});
function createRouterResponseResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateRouterResponseResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateRouterResponseResponseBody' from JSON`);
}
/** @internal */
exports.CreateRouterResponseResponse$inboundSchema = z.union([
    z.lazy(() => exports.CreateRouterResponseResponseBody$inboundSchema),
    z.instanceof((ReadableStream))
        .transform(stream => {
        return new event_streams_js_1.EventStream(stream, rawEvent => {
            if (rawEvent.data === "[DONE]")
                return { done: true, value: undefined };
            return {
                done: false,
                value: z.lazy(() => exports.CreateRouterResponseResponsesResponseBody$inboundSchema).parse(rawEvent),
            };
        }, { dataRequired: false });
    }),
]);
function createRouterResponseResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateRouterResponseResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateRouterResponseResponse' from JSON`);
}
//# sourceMappingURL=createrouterresponse.js.map