"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.StreamRunAgentLoadBalancerType$outboundSchema = exports.StreamRunAgentModelConfigurationCache$outboundSchema = exports.StreamRunAgentModelConfigurationType$outboundSchema = exports.StreamRunAgentModelConfigurationFallbacks$outboundSchema = exports.StreamRunAgentModelConfigurationGuardrails$outboundSchema = exports.StreamRunAgentModelConfigurationExecuteOn$outboundSchema = exports.StreamRunAgentModelConfigurationId$outboundSchema = exports.StreamRunAgentId1$outboundSchema = exports.StreamRunAgentModelConfigurationModalities$outboundSchema = exports.StreamRunAgentModelConfigurationToolChoice$outboundSchema = exports.StreamRunAgentToolChoice1$outboundSchema = exports.StreamRunAgentToolChoice2$outboundSchema = exports.StreamRunAgentToolChoiceFunction$outboundSchema = exports.StreamRunAgentToolChoiceType$outboundSchema = exports.StreamRunAgentModelConfigurationThinking$outboundSchema = exports.StreamRunAgentModelConfigurationStop$outboundSchema = exports.StreamRunAgentModelConfigurationReasoningEffort$outboundSchema = exports.StreamRunAgentModelConfigurationResponseFormat$outboundSchema = exports.StreamRunAgentResponseFormatText$outboundSchema = exports.StreamRunAgentResponseFormatJSONObject$outboundSchema = exports.StreamRunAgentResponseFormatJSONSchema$outboundSchema = exports.StreamRunAgentResponseFormatAgentsJsonSchema$outboundSchema = exports.StreamRunAgentAgentsExecuteOn = exports.StreamRunAgentExecuteOn = exports.StreamRunAgentToolApprovalRequired = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType = exports.AgentToolInputRunMethod = exports.AgentToolInputRunLanguage = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType = exports.AgentToolInputRunConnectionType = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType = exports.StreamRunAgentRoleUserMessage = exports.StreamRunAgentRoleToolMessage = exports.StreamRunAgentLoadBalancerAgentsType = exports.StreamRunAgentFallbackModelConfigurationType = exports.StreamRunAgentFallbackModelConfigurationExecuteOn = exports.StreamRunAgentIdAgents1 = exports.StreamRunAgentFallbackModelConfigurationModalities = exports.StreamRunAgentToolChoiceAgents1 = exports.StreamRunAgentToolChoiceAgentsType = exports.StreamRunAgentFallbackModelConfigurationReasoningEffort = exports.StreamRunAgentLoadBalancerType = exports.StreamRunAgentModelConfigurationType = exports.StreamRunAgentModelConfigurationExecuteOn = exports.StreamRunAgentId1 = exports.StreamRunAgentModelConfigurationModalities = exports.StreamRunAgentToolChoice1 = exports.StreamRunAgentToolChoiceType = exports.StreamRunAgentModelConfigurationReasoningEffort = void 0;
exports.StreamRunAgentAgentToolInputRunAgentsHeaders$outboundSchema = exports.StreamRunAgentTeamOfAgents$outboundSchema = exports.StreamRunAgentKnowledgeBases$outboundSchema = exports.StreamRunAgentMemory$outboundSchema = exports.StreamRunAgentThread$outboundSchema = exports.StreamRunAgentContact$outboundSchema = exports.StreamRunAgentIdentity$outboundSchema = exports.StreamRunAgentA2AMessage$outboundSchema = exports.StreamRunAgentPublicMessagePart$outboundSchema = exports.StreamRunAgentRole$outboundSchema = exports.StreamRunAgentRoleUserMessage$outboundSchema = exports.StreamRunAgentRoleToolMessage$outboundSchema = exports.StreamRunAgentFallbackModelConfiguration$outboundSchema = exports.StreamRunAgentFallbackModelConfiguration2$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationRetry$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationParameters$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationTimeout$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationLoadBalancer$outboundSchema = exports.StreamRunAgentLoadBalancerAgents1$outboundSchema = exports.StreamRunAgentLoadBalancerAgentsModels$outboundSchema = exports.StreamRunAgentLoadBalancerAgentsType$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationCache$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationType$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationFallbacks$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationGuardrails$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationExecuteOn$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationId$outboundSchema = exports.StreamRunAgentIdAgents1$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationModalities$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationToolChoice$outboundSchema = exports.StreamRunAgentToolChoiceAgents1$outboundSchema = exports.StreamRunAgentToolChoiceAgents2$outboundSchema = exports.StreamRunAgentToolChoiceAgentsFunction$outboundSchema = exports.StreamRunAgentToolChoiceAgentsType$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationThinking$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationStop$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationReasoningEffort$outboundSchema = exports.StreamRunAgentFallbackModelConfigurationResponseFormat$outboundSchema = exports.StreamRunAgentResponseFormatAgentsText$outboundSchema = exports.StreamRunAgentResponseFormatAgentsJSONObject$outboundSchema = exports.StreamRunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema = exports.StreamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema = exports.StreamRunAgentModelConfiguration$outboundSchema = exports.StreamRunAgentModelConfiguration2$outboundSchema = exports.StreamRunAgentModelConfigurationRetry$outboundSchema = exports.StreamRunAgentModelConfigurationParameters$outboundSchema = exports.StreamRunAgentModelConfigurationTimeout$outboundSchema = exports.StreamRunAgentModelConfigurationLoadBalancer$outboundSchema = exports.StreamRunAgentLoadBalancer1$outboundSchema = exports.StreamRunAgentLoadBalancerModels$outboundSchema = void 0;
exports.StreamRunAgentResponseBody$inboundSchema = exports.StreamRunAgentData$inboundSchema = exports.StreamRunAgentRequestBody$outboundSchema = exports.StreamRunAgentSettings$outboundSchema = exports.StreamRunAgentGuardrails$outboundSchema = exports.StreamRunAgentAgentsExecuteOn$outboundSchema = exports.StreamRunAgentEvaluators$outboundSchema = exports.StreamRunAgentExecuteOn$outboundSchema = exports.StreamRunAgentToolApprovalRequired$outboundSchema = exports.StreamRunAgentAgentToolInputRun$outboundSchema = exports.StreamRunAgentAgentToolInputRunGoogleSearchTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunWebScraperTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunCallSubAgentTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunRetrieveAgentsTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunQueryMemoryStoreTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunWriteMemoryStoreTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunRetrieveMemoryStoresTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunDeleteMemoryDocumentTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunQueryKnowledgeBaseTool$outboundSchema = exports.StreamRunAgentAgentToolInputRunCurrentDateTool$outboundSchema = exports.AgentToolInputRunHTTPToolRun$outboundSchema = exports.AgentToolInputRunHttp$outboundSchema = exports.AgentToolInputRunArguments$outboundSchema = exports.AgentToolInputRunDefaultValue$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType$outboundSchema = exports.AgentToolInputRunBlueprint$outboundSchema = exports.StreamRunAgentAgentToolInputRunHeaders$outboundSchema = exports.StreamRunAgentHeaders2$outboundSchema = exports.AgentToolInputRunMethod$outboundSchema = exports.AgentToolInputRunCodeToolRun$outboundSchema = exports.AgentToolInputRunCodeTool$outboundSchema = exports.AgentToolInputRunLanguage$outboundSchema = exports.StreamRunAgentAgentToolInputRunParameters$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType$outboundSchema = exports.AgentToolInputRunFunctionToolRun$outboundSchema = exports.StreamRunAgentAgentToolInputRunFunction$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsParameters$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType$outboundSchema = exports.AgentToolInputRunJSONSchemaToolRun$outboundSchema = exports.StreamRunAgentAgentToolInputRunJsonSchema$outboundSchema = exports.StreamRunAgentAgentToolInputRunSchema$outboundSchema = exports.AgentToolInputRunMCPToolRun$outboundSchema = exports.AgentToolInputRunMcp$outboundSchema = exports.AgentToolInputRunConnectionType$outboundSchema = exports.AgentToolInputRunTools$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema = exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType$outboundSchema = void 0;
exports.streamRunAgentResponseFormatAgentsJsonSchemaToJSON = streamRunAgentResponseFormatAgentsJsonSchemaToJSON;
exports.streamRunAgentResponseFormatJSONSchemaToJSON = streamRunAgentResponseFormatJSONSchemaToJSON;
exports.streamRunAgentResponseFormatJSONObjectToJSON = streamRunAgentResponseFormatJSONObjectToJSON;
exports.streamRunAgentResponseFormatTextToJSON = streamRunAgentResponseFormatTextToJSON;
exports.streamRunAgentModelConfigurationResponseFormatToJSON = streamRunAgentModelConfigurationResponseFormatToJSON;
exports.streamRunAgentModelConfigurationStopToJSON = streamRunAgentModelConfigurationStopToJSON;
exports.streamRunAgentModelConfigurationThinkingToJSON = streamRunAgentModelConfigurationThinkingToJSON;
exports.streamRunAgentToolChoiceFunctionToJSON = streamRunAgentToolChoiceFunctionToJSON;
exports.streamRunAgentToolChoice2ToJSON = streamRunAgentToolChoice2ToJSON;
exports.streamRunAgentModelConfigurationToolChoiceToJSON = streamRunAgentModelConfigurationToolChoiceToJSON;
exports.streamRunAgentModelConfigurationIdToJSON = streamRunAgentModelConfigurationIdToJSON;
exports.streamRunAgentModelConfigurationGuardrailsToJSON = streamRunAgentModelConfigurationGuardrailsToJSON;
exports.streamRunAgentModelConfigurationFallbacksToJSON = streamRunAgentModelConfigurationFallbacksToJSON;
exports.streamRunAgentModelConfigurationCacheToJSON = streamRunAgentModelConfigurationCacheToJSON;
exports.streamRunAgentLoadBalancerModelsToJSON = streamRunAgentLoadBalancerModelsToJSON;
exports.streamRunAgentLoadBalancer1ToJSON = streamRunAgentLoadBalancer1ToJSON;
exports.streamRunAgentModelConfigurationLoadBalancerToJSON = streamRunAgentModelConfigurationLoadBalancerToJSON;
exports.streamRunAgentModelConfigurationTimeoutToJSON = streamRunAgentModelConfigurationTimeoutToJSON;
exports.streamRunAgentModelConfigurationParametersToJSON = streamRunAgentModelConfigurationParametersToJSON;
exports.streamRunAgentModelConfigurationRetryToJSON = streamRunAgentModelConfigurationRetryToJSON;
exports.streamRunAgentModelConfiguration2ToJSON = streamRunAgentModelConfiguration2ToJSON;
exports.streamRunAgentModelConfigurationToJSON = streamRunAgentModelConfigurationToJSON;
exports.streamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchemaToJSON = streamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchemaToJSON;
exports.streamRunAgentResponseFormatAgentsRequestJSONSchemaToJSON = streamRunAgentResponseFormatAgentsRequestJSONSchemaToJSON;
exports.streamRunAgentResponseFormatAgentsJSONObjectToJSON = streamRunAgentResponseFormatAgentsJSONObjectToJSON;
exports.streamRunAgentResponseFormatAgentsTextToJSON = streamRunAgentResponseFormatAgentsTextToJSON;
exports.streamRunAgentFallbackModelConfigurationResponseFormatToJSON = streamRunAgentFallbackModelConfigurationResponseFormatToJSON;
exports.streamRunAgentFallbackModelConfigurationStopToJSON = streamRunAgentFallbackModelConfigurationStopToJSON;
exports.streamRunAgentFallbackModelConfigurationThinkingToJSON = streamRunAgentFallbackModelConfigurationThinkingToJSON;
exports.streamRunAgentToolChoiceAgentsFunctionToJSON = streamRunAgentToolChoiceAgentsFunctionToJSON;
exports.streamRunAgentToolChoiceAgents2ToJSON = streamRunAgentToolChoiceAgents2ToJSON;
exports.streamRunAgentFallbackModelConfigurationToolChoiceToJSON = streamRunAgentFallbackModelConfigurationToolChoiceToJSON;
exports.streamRunAgentFallbackModelConfigurationIdToJSON = streamRunAgentFallbackModelConfigurationIdToJSON;
exports.streamRunAgentFallbackModelConfigurationGuardrailsToJSON = streamRunAgentFallbackModelConfigurationGuardrailsToJSON;
exports.streamRunAgentFallbackModelConfigurationFallbacksToJSON = streamRunAgentFallbackModelConfigurationFallbacksToJSON;
exports.streamRunAgentFallbackModelConfigurationCacheToJSON = streamRunAgentFallbackModelConfigurationCacheToJSON;
exports.streamRunAgentLoadBalancerAgentsModelsToJSON = streamRunAgentLoadBalancerAgentsModelsToJSON;
exports.streamRunAgentLoadBalancerAgents1ToJSON = streamRunAgentLoadBalancerAgents1ToJSON;
exports.streamRunAgentFallbackModelConfigurationLoadBalancerToJSON = streamRunAgentFallbackModelConfigurationLoadBalancerToJSON;
exports.streamRunAgentFallbackModelConfigurationTimeoutToJSON = streamRunAgentFallbackModelConfigurationTimeoutToJSON;
exports.streamRunAgentFallbackModelConfigurationParametersToJSON = streamRunAgentFallbackModelConfigurationParametersToJSON;
exports.streamRunAgentFallbackModelConfigurationRetryToJSON = streamRunAgentFallbackModelConfigurationRetryToJSON;
exports.streamRunAgentFallbackModelConfiguration2ToJSON = streamRunAgentFallbackModelConfiguration2ToJSON;
exports.streamRunAgentFallbackModelConfigurationToJSON = streamRunAgentFallbackModelConfigurationToJSON;
exports.streamRunAgentRoleToJSON = streamRunAgentRoleToJSON;
exports.streamRunAgentPublicMessagePartToJSON = streamRunAgentPublicMessagePartToJSON;
exports.streamRunAgentA2AMessageToJSON = streamRunAgentA2AMessageToJSON;
exports.streamRunAgentIdentityToJSON = streamRunAgentIdentityToJSON;
exports.streamRunAgentContactToJSON = streamRunAgentContactToJSON;
exports.streamRunAgentThreadToJSON = streamRunAgentThreadToJSON;
exports.streamRunAgentMemoryToJSON = streamRunAgentMemoryToJSON;
exports.streamRunAgentKnowledgeBasesToJSON = streamRunAgentKnowledgeBasesToJSON;
exports.streamRunAgentTeamOfAgentsToJSON = streamRunAgentTeamOfAgentsToJSON;
exports.streamRunAgentAgentToolInputRunAgentsHeadersToJSON = streamRunAgentAgentToolInputRunAgentsHeadersToJSON;
exports.streamRunAgentAgentToolInputRunAgentsSchemaToJSON = streamRunAgentAgentToolInputRunAgentsSchemaToJSON;
exports.agentToolInputRunToolsToJSON = agentToolInputRunToolsToJSON;
exports.agentToolInputRunMcpToJSON = agentToolInputRunMcpToJSON;
exports.agentToolInputRunMCPToolRunToJSON = agentToolInputRunMCPToolRunToJSON;
exports.streamRunAgentAgentToolInputRunSchemaToJSON = streamRunAgentAgentToolInputRunSchemaToJSON;
exports.streamRunAgentAgentToolInputRunJsonSchemaToJSON = streamRunAgentAgentToolInputRunJsonSchemaToJSON;
exports.agentToolInputRunJSONSchemaToolRunToJSON = agentToolInputRunJSONSchemaToolRunToJSON;
exports.streamRunAgentAgentToolInputRunAgentsParametersToJSON = streamRunAgentAgentToolInputRunAgentsParametersToJSON;
exports.streamRunAgentAgentToolInputRunFunctionToJSON = streamRunAgentAgentToolInputRunFunctionToJSON;
exports.agentToolInputRunFunctionToolRunToJSON = agentToolInputRunFunctionToolRunToJSON;
exports.streamRunAgentAgentToolInputRunParametersToJSON = streamRunAgentAgentToolInputRunParametersToJSON;
exports.agentToolInputRunCodeToolToJSON = agentToolInputRunCodeToolToJSON;
exports.agentToolInputRunCodeToolRunToJSON = agentToolInputRunCodeToolRunToJSON;
exports.streamRunAgentHeaders2ToJSON = streamRunAgentHeaders2ToJSON;
exports.streamRunAgentAgentToolInputRunHeadersToJSON = streamRunAgentAgentToolInputRunHeadersToJSON;
exports.agentToolInputRunBlueprintToJSON = agentToolInputRunBlueprintToJSON;
exports.agentToolInputRunDefaultValueToJSON = agentToolInputRunDefaultValueToJSON;
exports.agentToolInputRunArgumentsToJSON = agentToolInputRunArgumentsToJSON;
exports.agentToolInputRunHttpToJSON = agentToolInputRunHttpToJSON;
exports.agentToolInputRunHTTPToolRunToJSON = agentToolInputRunHTTPToolRunToJSON;
exports.streamRunAgentAgentToolInputRunCurrentDateToolToJSON = streamRunAgentAgentToolInputRunCurrentDateToolToJSON;
exports.streamRunAgentAgentToolInputRunQueryKnowledgeBaseToolToJSON = streamRunAgentAgentToolInputRunQueryKnowledgeBaseToolToJSON;
exports.streamRunAgentAgentToolInputRunRetrieveKnowledgeBasesToolToJSON = streamRunAgentAgentToolInputRunRetrieveKnowledgeBasesToolToJSON;
exports.streamRunAgentAgentToolInputRunDeleteMemoryDocumentToolToJSON = streamRunAgentAgentToolInputRunDeleteMemoryDocumentToolToJSON;
exports.streamRunAgentAgentToolInputRunRetrieveMemoryStoresToolToJSON = streamRunAgentAgentToolInputRunRetrieveMemoryStoresToolToJSON;
exports.streamRunAgentAgentToolInputRunWriteMemoryStoreToolToJSON = streamRunAgentAgentToolInputRunWriteMemoryStoreToolToJSON;
exports.streamRunAgentAgentToolInputRunQueryMemoryStoreToolToJSON = streamRunAgentAgentToolInputRunQueryMemoryStoreToolToJSON;
exports.streamRunAgentAgentToolInputRunRetrieveAgentsToolToJSON = streamRunAgentAgentToolInputRunRetrieveAgentsToolToJSON;
exports.streamRunAgentAgentToolInputRunCallSubAgentToolToJSON = streamRunAgentAgentToolInputRunCallSubAgentToolToJSON;
exports.streamRunAgentAgentToolInputRunWebScraperToolToJSON = streamRunAgentAgentToolInputRunWebScraperToolToJSON;
exports.streamRunAgentAgentToolInputRunGoogleSearchToolToJSON = streamRunAgentAgentToolInputRunGoogleSearchToolToJSON;
exports.streamRunAgentAgentToolInputRunToJSON = streamRunAgentAgentToolInputRunToJSON;
exports.streamRunAgentEvaluatorsToJSON = streamRunAgentEvaluatorsToJSON;
exports.streamRunAgentGuardrailsToJSON = streamRunAgentGuardrailsToJSON;
exports.streamRunAgentSettingsToJSON = streamRunAgentSettingsToJSON;
exports.streamRunAgentRequestBodyToJSON = streamRunAgentRequestBodyToJSON;
exports.streamRunAgentDataFromJSON = streamRunAgentDataFromJSON;
exports.streamRunAgentResponseBodyFromJSON = streamRunAgentResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/**
 * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
 *
 * @remarks
 *
 * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
 * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
 * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
 * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
 *
 * Any of "none", "minimal", "low", "medium", "high", "xhigh".
 */
exports.StreamRunAgentModelConfigurationReasoningEffort = {
    None: "none",
    Minimal: "minimal",
    Low: "low",
    Medium: "medium",
    High: "high",
    Xhigh: "xhigh",
};
/**
 * The type of the tool. Currently, only function is supported.
 */
exports.StreamRunAgentToolChoiceType = {
    Function: "function",
};
exports.StreamRunAgentToolChoice1 = {
    None: "none",
    Auto: "auto",
    Required: "required",
};
exports.StreamRunAgentModelConfigurationModalities = {
    Text: "text",
    Audio: "audio",
};
/**
 * The key of the guardrail.
 */
exports.StreamRunAgentId1 = {
    OrqPiiDetection: "orq_pii_detection",
    OrqSexualModeration: "orq_sexual_moderation",
    OrqHarmfulModeration: "orq_harmful_moderation",
};
/**
 * Determines whether the guardrail runs on the input (user message) or output (model response).
 */
exports.StreamRunAgentModelConfigurationExecuteOn = {
    Input: "input",
    Output: "output",
};
exports.StreamRunAgentModelConfigurationType = {
    ExactMatch: "exact_match",
};
exports.StreamRunAgentLoadBalancerType = {
    WeightBased: "weight_based",
};
/**
 * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
 *
 * @remarks
 *
 * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
 * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
 * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
 * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
 *
 * Any of "none", "minimal", "low", "medium", "high", "xhigh".
 */
exports.StreamRunAgentFallbackModelConfigurationReasoningEffort = {
    None: "none",
    Minimal: "minimal",
    Low: "low",
    Medium: "medium",
    High: "high",
    Xhigh: "xhigh",
};
/**
 * The type of the tool. Currently, only function is supported.
 */
exports.StreamRunAgentToolChoiceAgentsType = {
    Function: "function",
};
exports.StreamRunAgentToolChoiceAgents1 = {
    None: "none",
    Auto: "auto",
    Required: "required",
};
exports.StreamRunAgentFallbackModelConfigurationModalities = {
    Text: "text",
    Audio: "audio",
};
/**
 * The key of the guardrail.
 */
exports.StreamRunAgentIdAgents1 = {
    OrqPiiDetection: "orq_pii_detection",
    OrqSexualModeration: "orq_sexual_moderation",
    OrqHarmfulModeration: "orq_harmful_moderation",
};
/**
 * Determines whether the guardrail runs on the input (user message) or output (model response).
 */
exports.StreamRunAgentFallbackModelConfigurationExecuteOn = {
    Input: "input",
    Output: "output",
};
exports.StreamRunAgentFallbackModelConfigurationType = {
    ExactMatch: "exact_match",
};
exports.StreamRunAgentLoadBalancerAgentsType = {
    WeightBased: "weight_based",
};
/**
 * Message containing tool execution results
 */
exports.StreamRunAgentRoleToolMessage = {
    Tool: "tool",
};
/**
 * Message from the end user
 */
exports.StreamRunAgentRoleUserMessage = {
    User: "user",
};
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType = {
    Object: "object",
};
/**
 * The connection type used by the MCP server
 */
exports.AgentToolInputRunConnectionType = {
    Http: "http",
    Sse: "sse",
};
/**
 * The type must be "object"
 */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType = {
    Object: "object",
};
/**
 * The type must be "object"
 */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType = {
    Object: "object",
};
exports.AgentToolInputRunLanguage = {
    Python: "python",
};
/**
 * The HTTP method to use.
 */
exports.AgentToolInputRunMethod = {
    Get: "GET",
    Post: "POST",
    Put: "PUT",
    Delete: "DELETE",
};
/**
 * The type of the argument.
 */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType = {
    String: "string",
    Number: "number",
    Boolean: "boolean",
};
/**
 * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
 */
exports.StreamRunAgentToolApprovalRequired = {
    All: "all",
    RespectTool: "respect_tool",
    None: "none",
};
/**
 * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
 */
exports.StreamRunAgentExecuteOn = {
    Input: "input",
    Output: "output",
};
/**
 * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
 */
exports.StreamRunAgentAgentsExecuteOn = {
    Input: "input",
    Output: "output",
};
/** @internal */
exports.StreamRunAgentResponseFormatAgentsJsonSchema$outboundSchema = z.object({
    description: z.string().optional(),
    name: z.string(),
    schema: z.any().optional(),
    strict: z.boolean().default(false),
});
function streamRunAgentResponseFormatAgentsJsonSchemaToJSON(streamRunAgentResponseFormatAgentsJsonSchema) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatAgentsJsonSchema$outboundSchema.parse(streamRunAgentResponseFormatAgentsJsonSchema));
}
/** @internal */
exports.StreamRunAgentResponseFormatJSONSchema$outboundSchema = z.object({
    type: z.literal("json_schema"),
    jsonSchema: z.lazy(() => exports.StreamRunAgentResponseFormatAgentsJsonSchema$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        jsonSchema: "json_schema",
    });
});
function streamRunAgentResponseFormatJSONSchemaToJSON(streamRunAgentResponseFormatJSONSchema) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatJSONSchema$outboundSchema.parse(streamRunAgentResponseFormatJSONSchema));
}
/** @internal */
exports.StreamRunAgentResponseFormatJSONObject$outboundSchema = z.object({
    type: z.literal("json_object"),
});
function streamRunAgentResponseFormatJSONObjectToJSON(streamRunAgentResponseFormatJSONObject) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatJSONObject$outboundSchema.parse(streamRunAgentResponseFormatJSONObject));
}
/** @internal */
exports.StreamRunAgentResponseFormatText$outboundSchema = z.object({
    type: z.literal("text"),
});
function streamRunAgentResponseFormatTextToJSON(streamRunAgentResponseFormatText) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatText$outboundSchema.parse(streamRunAgentResponseFormatText));
}
/** @internal */
exports.StreamRunAgentModelConfigurationResponseFormat$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentResponseFormatText$outboundSchema),
    z.lazy(() => exports.StreamRunAgentResponseFormatJSONObject$outboundSchema),
    z.lazy(() => exports.StreamRunAgentResponseFormatJSONSchema$outboundSchema),
]);
function streamRunAgentModelConfigurationResponseFormatToJSON(streamRunAgentModelConfigurationResponseFormat) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationResponseFormat$outboundSchema.parse(streamRunAgentModelConfigurationResponseFormat));
}
/** @internal */
exports.StreamRunAgentModelConfigurationReasoningEffort$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentModelConfigurationReasoningEffort);
/** @internal */
exports.StreamRunAgentModelConfigurationStop$outboundSchema = z.union([z.string(), z.array(z.string())]);
function streamRunAgentModelConfigurationStopToJSON(streamRunAgentModelConfigurationStop) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationStop$outboundSchema.parse(streamRunAgentModelConfigurationStop));
}
/** @internal */
exports.StreamRunAgentModelConfigurationThinking$outboundSchema = z.union([
    components.ThinkingConfigDisabledSchema$outboundSchema,
    components.ThinkingConfigEnabledSchema$outboundSchema,
    components.ThinkingConfigAdaptiveSchema$outboundSchema,
]);
function streamRunAgentModelConfigurationThinkingToJSON(streamRunAgentModelConfigurationThinking) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationThinking$outboundSchema.parse(streamRunAgentModelConfigurationThinking));
}
/** @internal */
exports.StreamRunAgentToolChoiceType$outboundSchema = z.nativeEnum(exports.StreamRunAgentToolChoiceType);
/** @internal */
exports.StreamRunAgentToolChoiceFunction$outboundSchema = z.object({
    name: z.string(),
});
function streamRunAgentToolChoiceFunctionToJSON(streamRunAgentToolChoiceFunction) {
    return JSON.stringify(exports.StreamRunAgentToolChoiceFunction$outboundSchema.parse(streamRunAgentToolChoiceFunction));
}
/** @internal */
exports.StreamRunAgentToolChoice2$outboundSchema = z.object({
    type: exports.StreamRunAgentToolChoiceType$outboundSchema.optional(),
    function: z.lazy(() => exports.StreamRunAgentToolChoiceFunction$outboundSchema),
});
function streamRunAgentToolChoice2ToJSON(streamRunAgentToolChoice2) {
    return JSON.stringify(exports.StreamRunAgentToolChoice2$outboundSchema.parse(streamRunAgentToolChoice2));
}
/** @internal */
exports.StreamRunAgentToolChoice1$outboundSchema = z.nativeEnum(exports.StreamRunAgentToolChoice1);
/** @internal */
exports.StreamRunAgentModelConfigurationToolChoice$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentToolChoice2$outboundSchema),
    exports.StreamRunAgentToolChoice1$outboundSchema,
]);
function streamRunAgentModelConfigurationToolChoiceToJSON(streamRunAgentModelConfigurationToolChoice) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationToolChoice$outboundSchema.parse(streamRunAgentModelConfigurationToolChoice));
}
/** @internal */
exports.StreamRunAgentModelConfigurationModalities$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentModelConfigurationModalities);
/** @internal */
exports.StreamRunAgentId1$outboundSchema = z.nativeEnum(exports.StreamRunAgentId1);
/** @internal */
exports.StreamRunAgentModelConfigurationId$outboundSchema = z.union([exports.StreamRunAgentId1$outboundSchema, z.string()]);
function streamRunAgentModelConfigurationIdToJSON(streamRunAgentModelConfigurationId) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationId$outboundSchema.parse(streamRunAgentModelConfigurationId));
}
/** @internal */
exports.StreamRunAgentModelConfigurationExecuteOn$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentModelConfigurationExecuteOn);
/** @internal */
exports.StreamRunAgentModelConfigurationGuardrails$outboundSchema = z.object({
    id: z.union([exports.StreamRunAgentId1$outboundSchema, z.string()]),
    executeOn: exports.StreamRunAgentModelConfigurationExecuteOn$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        executeOn: "execute_on",
    });
});
function streamRunAgentModelConfigurationGuardrailsToJSON(streamRunAgentModelConfigurationGuardrails) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationGuardrails$outboundSchema.parse(streamRunAgentModelConfigurationGuardrails));
}
/** @internal */
exports.StreamRunAgentModelConfigurationFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function streamRunAgentModelConfigurationFallbacksToJSON(streamRunAgentModelConfigurationFallbacks) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationFallbacks$outboundSchema.parse(streamRunAgentModelConfigurationFallbacks));
}
/** @internal */
exports.StreamRunAgentModelConfigurationType$outboundSchema = z.nativeEnum(exports.StreamRunAgentModelConfigurationType);
/** @internal */
exports.StreamRunAgentModelConfigurationCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.StreamRunAgentModelConfigurationType$outboundSchema,
});
function streamRunAgentModelConfigurationCacheToJSON(streamRunAgentModelConfigurationCache) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationCache$outboundSchema.parse(streamRunAgentModelConfigurationCache));
}
/** @internal */
exports.StreamRunAgentLoadBalancerType$outboundSchema = z.nativeEnum(exports.StreamRunAgentLoadBalancerType);
/** @internal */
exports.StreamRunAgentLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function streamRunAgentLoadBalancerModelsToJSON(streamRunAgentLoadBalancerModels) {
    return JSON.stringify(exports.StreamRunAgentLoadBalancerModels$outboundSchema.parse(streamRunAgentLoadBalancerModels));
}
/** @internal */
exports.StreamRunAgentLoadBalancer1$outboundSchema = z.object({
    type: exports.StreamRunAgentLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.StreamRunAgentLoadBalancerModels$outboundSchema)),
});
function streamRunAgentLoadBalancer1ToJSON(streamRunAgentLoadBalancer1) {
    return JSON.stringify(exports.StreamRunAgentLoadBalancer1$outboundSchema.parse(streamRunAgentLoadBalancer1));
}
/** @internal */
exports.StreamRunAgentModelConfigurationLoadBalancer$outboundSchema = z.lazy(() => exports.StreamRunAgentLoadBalancer1$outboundSchema);
function streamRunAgentModelConfigurationLoadBalancerToJSON(streamRunAgentModelConfigurationLoadBalancer) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationLoadBalancer$outboundSchema.parse(streamRunAgentModelConfigurationLoadBalancer));
}
/** @internal */
exports.StreamRunAgentModelConfigurationTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function streamRunAgentModelConfigurationTimeoutToJSON(streamRunAgentModelConfigurationTimeout) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationTimeout$outboundSchema.parse(streamRunAgentModelConfigurationTimeout));
}
/** @internal */
exports.StreamRunAgentModelConfigurationParameters$outboundSchema = z.object({
    name: z.string().optional(),
    frequencyPenalty: z.nullable(z.number()).optional(),
    maxTokens: z.nullable(z.number().int()).optional(),
    maxCompletionTokens: z.nullable(z.number().int()).optional(),
    presencePenalty: z.nullable(z.number()).optional(),
    responseFormat: z.union([
        z.lazy(() => exports.StreamRunAgentResponseFormatText$outboundSchema),
        z.lazy(() => exports.StreamRunAgentResponseFormatJSONObject$outboundSchema),
        z.lazy(() => exports.StreamRunAgentResponseFormatJSONSchema$outboundSchema),
    ]).optional(),
    reasoningEffort: exports.StreamRunAgentModelConfigurationReasoningEffort$outboundSchema.optional(),
    verbosity: z.string().optional(),
    seed: z.nullable(z.number()).optional(),
    stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
    thinking: z.union([
        components.ThinkingConfigDisabledSchema$outboundSchema,
        components.ThinkingConfigEnabledSchema$outboundSchema,
        components.ThinkingConfigAdaptiveSchema$outboundSchema,
    ]).optional(),
    temperature: z.nullable(z.number()).optional(),
    topP: z.nullable(z.number()).optional(),
    topK: z.nullable(z.number()).optional(),
    toolChoice: z.union([
        z.lazy(() => exports.StreamRunAgentToolChoice2$outboundSchema),
        exports.StreamRunAgentToolChoice1$outboundSchema,
    ]).optional(),
    parallelToolCalls: z.boolean().optional(),
    modalities: z.nullable(z.array(exports.StreamRunAgentModelConfigurationModalities$outboundSchema)).optional(),
    guardrails: z.array(z.lazy(() => exports.StreamRunAgentModelConfigurationGuardrails$outboundSchema)).optional(),
    fallbacks: z.array(z.lazy(() => exports.StreamRunAgentModelConfigurationFallbacks$outboundSchema)).optional(),
    cache: z.lazy(() => exports.StreamRunAgentModelConfigurationCache$outboundSchema)
        .optional(),
    loadBalancer: z.lazy(() => exports.StreamRunAgentLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.StreamRunAgentModelConfigurationTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        frequencyPenalty: "frequency_penalty",
        maxTokens: "max_tokens",
        maxCompletionTokens: "max_completion_tokens",
        presencePenalty: "presence_penalty",
        responseFormat: "response_format",
        reasoningEffort: "reasoning_effort",
        topP: "top_p",
        topK: "top_k",
        toolChoice: "tool_choice",
        parallelToolCalls: "parallel_tool_calls",
        loadBalancer: "load_balancer",
    });
});
function streamRunAgentModelConfigurationParametersToJSON(streamRunAgentModelConfigurationParameters) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationParameters$outboundSchema.parse(streamRunAgentModelConfigurationParameters));
}
/** @internal */
exports.StreamRunAgentModelConfigurationRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function streamRunAgentModelConfigurationRetryToJSON(streamRunAgentModelConfigurationRetry) {
    return JSON.stringify(exports.StreamRunAgentModelConfigurationRetry$outboundSchema.parse(streamRunAgentModelConfigurationRetry));
}
/** @internal */
exports.StreamRunAgentModelConfiguration2$outboundSchema = z.object({
    id: z.string(),
    parameters: z.lazy(() => exports.StreamRunAgentModelConfigurationParameters$outboundSchema).optional(),
    retry: z.lazy(() => exports.StreamRunAgentModelConfigurationRetry$outboundSchema)
        .optional(),
});
function streamRunAgentModelConfiguration2ToJSON(streamRunAgentModelConfiguration2) {
    return JSON.stringify(exports.StreamRunAgentModelConfiguration2$outboundSchema.parse(streamRunAgentModelConfiguration2));
}
/** @internal */
exports.StreamRunAgentModelConfiguration$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentModelConfiguration2$outboundSchema),
    z.string(),
]);
function streamRunAgentModelConfigurationToJSON(streamRunAgentModelConfiguration) {
    return JSON.stringify(exports.StreamRunAgentModelConfiguration$outboundSchema.parse(streamRunAgentModelConfiguration));
}
/** @internal */
exports.StreamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema = z.object({
    description: z.string().optional(),
    name: z.string(),
    schema: z.any().optional(),
    strict: z.boolean().default(false),
});
function streamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchemaToJSON(streamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema
        .parse(streamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema));
}
/** @internal */
exports.StreamRunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema = z.object({
    type: z.literal("json_schema"),
    jsonSchema: z.lazy(() => exports.StreamRunAgentResponseFormatAgentsRequestRequestBodyJsonSchema$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        jsonSchema: "json_schema",
    });
});
function streamRunAgentResponseFormatAgentsRequestJSONSchemaToJSON(streamRunAgentResponseFormatAgentsRequestJSONSchema) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema.parse(streamRunAgentResponseFormatAgentsRequestJSONSchema));
}
/** @internal */
exports.StreamRunAgentResponseFormatAgentsJSONObject$outboundSchema = z.object({
    type: z.literal("json_object"),
});
function streamRunAgentResponseFormatAgentsJSONObjectToJSON(streamRunAgentResponseFormatAgentsJSONObject) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatAgentsJSONObject$outboundSchema.parse(streamRunAgentResponseFormatAgentsJSONObject));
}
/** @internal */
exports.StreamRunAgentResponseFormatAgentsText$outboundSchema = z.object({
    type: z.literal("text"),
});
function streamRunAgentResponseFormatAgentsTextToJSON(streamRunAgentResponseFormatAgentsText) {
    return JSON.stringify(exports.StreamRunAgentResponseFormatAgentsText$outboundSchema.parse(streamRunAgentResponseFormatAgentsText));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationResponseFormat$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentResponseFormatAgentsText$outboundSchema),
    z.lazy(() => exports.StreamRunAgentResponseFormatAgentsJSONObject$outboundSchema),
    z.lazy(() => exports.StreamRunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema),
]);
function streamRunAgentFallbackModelConfigurationResponseFormatToJSON(streamRunAgentFallbackModelConfigurationResponseFormat) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationResponseFormat$outboundSchema.parse(streamRunAgentFallbackModelConfigurationResponseFormat));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationReasoningEffort$outboundSchema = z.nativeEnum(exports.StreamRunAgentFallbackModelConfigurationReasoningEffort);
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationStop$outboundSchema = z.union([z.string(), z.array(z.string())]);
function streamRunAgentFallbackModelConfigurationStopToJSON(streamRunAgentFallbackModelConfigurationStop) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationStop$outboundSchema.parse(streamRunAgentFallbackModelConfigurationStop));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationThinking$outboundSchema = z.union([
    components.ThinkingConfigDisabledSchema$outboundSchema,
    components.ThinkingConfigEnabledSchema$outboundSchema,
    components.ThinkingConfigAdaptiveSchema$outboundSchema,
]);
function streamRunAgentFallbackModelConfigurationThinkingToJSON(streamRunAgentFallbackModelConfigurationThinking) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationThinking$outboundSchema.parse(streamRunAgentFallbackModelConfigurationThinking));
}
/** @internal */
exports.StreamRunAgentToolChoiceAgentsType$outboundSchema = z.nativeEnum(exports.StreamRunAgentToolChoiceAgentsType);
/** @internal */
exports.StreamRunAgentToolChoiceAgentsFunction$outboundSchema = z.object({
    name: z.string(),
});
function streamRunAgentToolChoiceAgentsFunctionToJSON(streamRunAgentToolChoiceAgentsFunction) {
    return JSON.stringify(exports.StreamRunAgentToolChoiceAgentsFunction$outboundSchema.parse(streamRunAgentToolChoiceAgentsFunction));
}
/** @internal */
exports.StreamRunAgentToolChoiceAgents2$outboundSchema = z.object({
    type: exports.StreamRunAgentToolChoiceAgentsType$outboundSchema.optional(),
    function: z.lazy(() => exports.StreamRunAgentToolChoiceAgentsFunction$outboundSchema),
});
function streamRunAgentToolChoiceAgents2ToJSON(streamRunAgentToolChoiceAgents2) {
    return JSON.stringify(exports.StreamRunAgentToolChoiceAgents2$outboundSchema.parse(streamRunAgentToolChoiceAgents2));
}
/** @internal */
exports.StreamRunAgentToolChoiceAgents1$outboundSchema = z.nativeEnum(exports.StreamRunAgentToolChoiceAgents1);
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationToolChoice$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentToolChoiceAgents2$outboundSchema),
    exports.StreamRunAgentToolChoiceAgents1$outboundSchema,
]);
function streamRunAgentFallbackModelConfigurationToolChoiceToJSON(streamRunAgentFallbackModelConfigurationToolChoice) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationToolChoice$outboundSchema.parse(streamRunAgentFallbackModelConfigurationToolChoice));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationModalities$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentFallbackModelConfigurationModalities);
/** @internal */
exports.StreamRunAgentIdAgents1$outboundSchema = z.nativeEnum(exports.StreamRunAgentIdAgents1);
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationId$outboundSchema = z.union([exports.StreamRunAgentIdAgents1$outboundSchema, z.string()]);
function streamRunAgentFallbackModelConfigurationIdToJSON(streamRunAgentFallbackModelConfigurationId) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationId$outboundSchema.parse(streamRunAgentFallbackModelConfigurationId));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationExecuteOn$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentFallbackModelConfigurationExecuteOn);
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationGuardrails$outboundSchema = z.object({
    id: z.union([exports.StreamRunAgentIdAgents1$outboundSchema, z.string()]),
    executeOn: exports.StreamRunAgentFallbackModelConfigurationExecuteOn$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        executeOn: "execute_on",
    });
});
function streamRunAgentFallbackModelConfigurationGuardrailsToJSON(streamRunAgentFallbackModelConfigurationGuardrails) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationGuardrails$outboundSchema.parse(streamRunAgentFallbackModelConfigurationGuardrails));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function streamRunAgentFallbackModelConfigurationFallbacksToJSON(streamRunAgentFallbackModelConfigurationFallbacks) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationFallbacks$outboundSchema.parse(streamRunAgentFallbackModelConfigurationFallbacks));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationType$outboundSchema = z
    .nativeEnum(exports.StreamRunAgentFallbackModelConfigurationType);
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationCache$outboundSchema = z.object({
    ttl: z.number().default(1800),
    type: exports.StreamRunAgentFallbackModelConfigurationType$outboundSchema,
});
function streamRunAgentFallbackModelConfigurationCacheToJSON(streamRunAgentFallbackModelConfigurationCache) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationCache$outboundSchema.parse(streamRunAgentFallbackModelConfigurationCache));
}
/** @internal */
exports.StreamRunAgentLoadBalancerAgentsType$outboundSchema = z.nativeEnum(exports.StreamRunAgentLoadBalancerAgentsType);
/** @internal */
exports.StreamRunAgentLoadBalancerAgentsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function streamRunAgentLoadBalancerAgentsModelsToJSON(streamRunAgentLoadBalancerAgentsModels) {
    return JSON.stringify(exports.StreamRunAgentLoadBalancerAgentsModels$outboundSchema.parse(streamRunAgentLoadBalancerAgentsModels));
}
/** @internal */
exports.StreamRunAgentLoadBalancerAgents1$outboundSchema = z.object({
    type: exports.StreamRunAgentLoadBalancerAgentsType$outboundSchema,
    models: z.array(z.lazy(() => exports.StreamRunAgentLoadBalancerAgentsModels$outboundSchema)),
});
function streamRunAgentLoadBalancerAgents1ToJSON(streamRunAgentLoadBalancerAgents1) {
    return JSON.stringify(exports.StreamRunAgentLoadBalancerAgents1$outboundSchema.parse(streamRunAgentLoadBalancerAgents1));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationLoadBalancer$outboundSchema = z.lazy(() => exports.StreamRunAgentLoadBalancerAgents1$outboundSchema);
function streamRunAgentFallbackModelConfigurationLoadBalancerToJSON(streamRunAgentFallbackModelConfigurationLoadBalancer) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationLoadBalancer$outboundSchema.parse(streamRunAgentFallbackModelConfigurationLoadBalancer));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function streamRunAgentFallbackModelConfigurationTimeoutToJSON(streamRunAgentFallbackModelConfigurationTimeout) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationTimeout$outboundSchema.parse(streamRunAgentFallbackModelConfigurationTimeout));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationParameters$outboundSchema = z.object({
    name: z.string().optional(),
    frequencyPenalty: z.nullable(z.number()).optional(),
    maxTokens: z.nullable(z.number().int()).optional(),
    maxCompletionTokens: z.nullable(z.number().int()).optional(),
    presencePenalty: z.nullable(z.number()).optional(),
    responseFormat: z.union([
        z.lazy(() => exports.StreamRunAgentResponseFormatAgentsText$outboundSchema),
        z.lazy(() => exports.StreamRunAgentResponseFormatAgentsJSONObject$outboundSchema),
        z.lazy(() => exports.StreamRunAgentResponseFormatAgentsRequestJSONSchema$outboundSchema),
    ]).optional(),
    reasoningEffort: exports.StreamRunAgentFallbackModelConfigurationReasoningEffort$outboundSchema
        .optional(),
    verbosity: z.string().optional(),
    seed: z.nullable(z.number()).optional(),
    stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
    thinking: z.union([
        components.ThinkingConfigDisabledSchema$outboundSchema,
        components.ThinkingConfigEnabledSchema$outboundSchema,
        components.ThinkingConfigAdaptiveSchema$outboundSchema,
    ]).optional(),
    temperature: z.nullable(z.number()).optional(),
    topP: z.nullable(z.number()).optional(),
    topK: z.nullable(z.number()).optional(),
    toolChoice: z.union([
        z.lazy(() => exports.StreamRunAgentToolChoiceAgents2$outboundSchema),
        exports.StreamRunAgentToolChoiceAgents1$outboundSchema,
    ]).optional(),
    parallelToolCalls: z.boolean().optional(),
    modalities: z.nullable(z.array(exports.StreamRunAgentFallbackModelConfigurationModalities$outboundSchema)).optional(),
    guardrails: z.array(z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationGuardrails$outboundSchema)).optional(),
    fallbacks: z.array(z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationFallbacks$outboundSchema)).optional(),
    cache: z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationCache$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.StreamRunAgentLoadBalancerAgents1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        frequencyPenalty: "frequency_penalty",
        maxTokens: "max_tokens",
        maxCompletionTokens: "max_completion_tokens",
        presencePenalty: "presence_penalty",
        responseFormat: "response_format",
        reasoningEffort: "reasoning_effort",
        topP: "top_p",
        topK: "top_k",
        toolChoice: "tool_choice",
        parallelToolCalls: "parallel_tool_calls",
        loadBalancer: "load_balancer",
    });
});
function streamRunAgentFallbackModelConfigurationParametersToJSON(streamRunAgentFallbackModelConfigurationParameters) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationParameters$outboundSchema.parse(streamRunAgentFallbackModelConfigurationParameters));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfigurationRetry$outboundSchema = z.object({
    count: z.number().default(3),
    onCodes: z.array(z.number()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function streamRunAgentFallbackModelConfigurationRetryToJSON(streamRunAgentFallbackModelConfigurationRetry) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfigurationRetry$outboundSchema.parse(streamRunAgentFallbackModelConfigurationRetry));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfiguration2$outboundSchema = z.object({
    id: z.string(),
    parameters: z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationParameters$outboundSchema).optional(),
    retry: z.lazy(() => exports.StreamRunAgentFallbackModelConfigurationRetry$outboundSchema).optional(),
});
function streamRunAgentFallbackModelConfiguration2ToJSON(streamRunAgentFallbackModelConfiguration2) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfiguration2$outboundSchema.parse(streamRunAgentFallbackModelConfiguration2));
}
/** @internal */
exports.StreamRunAgentFallbackModelConfiguration$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentFallbackModelConfiguration2$outboundSchema),
    z.string(),
]);
function streamRunAgentFallbackModelConfigurationToJSON(streamRunAgentFallbackModelConfiguration) {
    return JSON.stringify(exports.StreamRunAgentFallbackModelConfiguration$outboundSchema.parse(streamRunAgentFallbackModelConfiguration));
}
/** @internal */
exports.StreamRunAgentRoleToolMessage$outboundSchema = z.nativeEnum(exports.StreamRunAgentRoleToolMessage);
/** @internal */
exports.StreamRunAgentRoleUserMessage$outboundSchema = z.nativeEnum(exports.StreamRunAgentRoleUserMessage);
/** @internal */
exports.StreamRunAgentRole$outboundSchema = z.union([
    exports.StreamRunAgentRoleUserMessage$outboundSchema,
    exports.StreamRunAgentRoleToolMessage$outboundSchema,
]);
function streamRunAgentRoleToJSON(streamRunAgentRole) {
    return JSON.stringify(exports.StreamRunAgentRole$outboundSchema.parse(streamRunAgentRole));
}
/** @internal */
exports.StreamRunAgentPublicMessagePart$outboundSchema = z.union([
    components.TextPart$outboundSchema,
    components.FilePart$outboundSchema,
    components.ToolResultPart$outboundSchema,
    components.ErrorPart$outboundSchema,
]);
function streamRunAgentPublicMessagePartToJSON(streamRunAgentPublicMessagePart) {
    return JSON.stringify(exports.StreamRunAgentPublicMessagePart$outboundSchema.parse(streamRunAgentPublicMessagePart));
}
/** @internal */
exports.StreamRunAgentA2AMessage$outboundSchema = z.object({
    messageId: z.string().optional(),
    role: z.union([
        exports.StreamRunAgentRoleUserMessage$outboundSchema,
        exports.StreamRunAgentRoleToolMessage$outboundSchema,
    ]),
    parts: z.array(z.union([
        components.TextPart$outboundSchema,
        components.FilePart$outboundSchema,
        components.ToolResultPart$outboundSchema,
        components.ErrorPart$outboundSchema,
    ])),
});
function streamRunAgentA2AMessageToJSON(streamRunAgentA2AMessage) {
    return JSON.stringify(exports.StreamRunAgentA2AMessage$outboundSchema.parse(streamRunAgentA2AMessage));
}
/** @internal */
exports.StreamRunAgentIdentity$outboundSchema = z.object({
    id: z.string(),
    displayName: z.string().optional(),
    email: z.string().optional(),
    metadata: z.array(z.record(z.any())).optional(),
    logoUrl: z.string().optional(),
    tags: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        logoUrl: "logo_url",
    });
});
function streamRunAgentIdentityToJSON(streamRunAgentIdentity) {
    return JSON.stringify(exports.StreamRunAgentIdentity$outboundSchema.parse(streamRunAgentIdentity));
}
/** @internal */
exports.StreamRunAgentContact$outboundSchema = z.object({
    id: z.string(),
    displayName: z.string().optional(),
    email: z.string().optional(),
    metadata: z.array(z.record(z.any())).optional(),
    logoUrl: z.string().optional(),
    tags: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        logoUrl: "logo_url",
    });
});
function streamRunAgentContactToJSON(streamRunAgentContact) {
    return JSON.stringify(exports.StreamRunAgentContact$outboundSchema.parse(streamRunAgentContact));
}
/** @internal */
exports.StreamRunAgentThread$outboundSchema = z.object({
    id: z.string(),
    tags: z.array(z.string()).optional(),
});
function streamRunAgentThreadToJSON(streamRunAgentThread) {
    return JSON.stringify(exports.StreamRunAgentThread$outboundSchema.parse(streamRunAgentThread));
}
/** @internal */
exports.StreamRunAgentMemory$outboundSchema = z.object({
    entityId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        entityId: "entity_id",
    });
});
function streamRunAgentMemoryToJSON(streamRunAgentMemory) {
    return JSON.stringify(exports.StreamRunAgentMemory$outboundSchema.parse(streamRunAgentMemory));
}
/** @internal */
exports.StreamRunAgentKnowledgeBases$outboundSchema = z.object({
    knowledgeId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
    });
});
function streamRunAgentKnowledgeBasesToJSON(streamRunAgentKnowledgeBases) {
    return JSON.stringify(exports.StreamRunAgentKnowledgeBases$outboundSchema.parse(streamRunAgentKnowledgeBases));
}
/** @internal */
exports.StreamRunAgentTeamOfAgents$outboundSchema = z.object({
    key: z.string(),
    role: z.string().optional(),
});
function streamRunAgentTeamOfAgentsToJSON(streamRunAgentTeamOfAgents) {
    return JSON.stringify(exports.StreamRunAgentTeamOfAgents$outboundSchema.parse(streamRunAgentTeamOfAgents));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsHeaders$outboundSchema = z.object({
    value: z.string(),
    encrypted: z.boolean().default(false),
});
function streamRunAgentAgentToolInputRunAgentsHeadersToJSON(streamRunAgentAgentToolInputRunAgentsHeaders) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunAgentsHeaders$outboundSchema.parse(streamRunAgentAgentToolInputRunAgentsHeaders));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType$outboundSchema = z.nativeEnum(exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType);
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema = z.object({
    type: exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools16McpType$outboundSchema,
    properties: z.record(z.any()).optional(),
    required: z.array(z.string()).optional(),
});
function streamRunAgentAgentToolInputRunAgentsSchemaToJSON(streamRunAgentAgentToolInputRunAgentsSchema) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema.parse(streamRunAgentAgentToolInputRunAgentsSchema));
}
/** @internal */
exports.AgentToolInputRunTools$outboundSchema = z.object({
    id: z.string().default("01KMJY30KWQ9RWCDS8Z77VM3RZ"),
    name: z.string(),
    description: z.string().optional(),
    schema: z.lazy(() => exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema),
});
function agentToolInputRunToolsToJSON(agentToolInputRunTools) {
    return JSON.stringify(exports.AgentToolInputRunTools$outboundSchema.parse(agentToolInputRunTools));
}
/** @internal */
exports.AgentToolInputRunConnectionType$outboundSchema = z.nativeEnum(exports.AgentToolInputRunConnectionType);
/** @internal */
exports.AgentToolInputRunMcp$outboundSchema = z.object({
    serverUrl: z.string(),
    headers: z.record(z.lazy(() => exports.StreamRunAgentAgentToolInputRunAgentsHeaders$outboundSchema)).optional(),
    tools: z.array(z.lazy(() => exports.AgentToolInputRunTools$outboundSchema)),
    connectionType: exports.AgentToolInputRunConnectionType$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        serverUrl: "server_url",
        connectionType: "connection_type",
    });
});
function agentToolInputRunMcpToJSON(agentToolInputRunMcp) {
    return JSON.stringify(exports.AgentToolInputRunMcp$outboundSchema.parse(agentToolInputRunMcp));
}
/** @internal */
exports.AgentToolInputRunMCPToolRun$outboundSchema = z.object({
    type: z.literal("mcp"),
    key: z.string(),
    id: z.string().optional(),
    displayName: z.string().optional(),
    description: z.string(),
    mcp: z.lazy(() => exports.AgentToolInputRunMcp$outboundSchema),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        requiresApproval: "requires_approval",
    });
});
function agentToolInputRunMCPToolRunToJSON(agentToolInputRunMCPToolRun) {
    return JSON.stringify(exports.AgentToolInputRunMCPToolRun$outboundSchema.parse(agentToolInputRunMCPToolRun));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunSchema$outboundSchema = z.object({
    type: z.string(),
    properties: z.record(z.any()),
    required: z.array(z.string()),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function streamRunAgentAgentToolInputRunSchemaToJSON(streamRunAgentAgentToolInputRunSchema) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunSchema$outboundSchema.parse(streamRunAgentAgentToolInputRunSchema));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunJsonSchema$outboundSchema = z.object({
    name: z.string(),
    description: z.string(),
    schema: z.lazy(() => exports.StreamRunAgentAgentToolInputRunSchema$outboundSchema),
    strict: z.boolean().optional(),
});
function streamRunAgentAgentToolInputRunJsonSchemaToJSON(streamRunAgentAgentToolInputRunJsonSchema) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunJsonSchema$outboundSchema.parse(streamRunAgentAgentToolInputRunJsonSchema));
}
/** @internal */
exports.AgentToolInputRunJSONSchemaToolRun$outboundSchema = z.object({
    type: z.literal("json_schema"),
    key: z.string(),
    id: z.string().optional(),
    displayName: z.string().optional(),
    description: z.string(),
    jsonSchema: z.lazy(() => exports.StreamRunAgentAgentToolInputRunJsonSchema$outboundSchema),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        jsonSchema: "json_schema",
        requiresApproval: "requires_approval",
    });
});
function agentToolInputRunJSONSchemaToolRunToJSON(agentToolInputRunJSONSchemaToolRun) {
    return JSON.stringify(exports.AgentToolInputRunJSONSchemaToolRun$outboundSchema.parse(agentToolInputRunJSONSchemaToolRun));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType$outboundSchema = z.nativeEnum(exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType);
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsParameters$outboundSchema = z.object({
    type: exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools14FunctionType$outboundSchema,
    properties: z.record(z.any()),
    required: z.array(z.string()),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function streamRunAgentAgentToolInputRunAgentsParametersToJSON(streamRunAgentAgentToolInputRunAgentsParameters) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunAgentsParameters$outboundSchema.parse(streamRunAgentAgentToolInputRunAgentsParameters));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunFunction$outboundSchema = z.object({
    name: z.string(),
    description: z.string().optional(),
    strict: z.boolean().optional(),
    parameters: z.lazy(() => exports.StreamRunAgentAgentToolInputRunAgentsParameters$outboundSchema).optional(),
});
function streamRunAgentAgentToolInputRunFunctionToJSON(streamRunAgentAgentToolInputRunFunction) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunFunction$outboundSchema.parse(streamRunAgentAgentToolInputRunFunction));
}
/** @internal */
exports.AgentToolInputRunFunctionToolRun$outboundSchema = z.object({
    type: z.literal("function"),
    key: z.string(),
    id: z.string().optional(),
    displayName: z.string().optional(),
    description: z.string().optional(),
    function: z.lazy(() => exports.StreamRunAgentAgentToolInputRunFunction$outboundSchema),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        requiresApproval: "requires_approval",
    });
});
function agentToolInputRunFunctionToolRunToJSON(agentToolInputRunFunctionToolRun) {
    return JSON.stringify(exports.AgentToolInputRunFunctionToolRun$outboundSchema.parse(agentToolInputRunFunctionToolRun));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType$outboundSchema = z.nativeEnum(exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType);
/** @internal */
exports.StreamRunAgentAgentToolInputRunParameters$outboundSchema = z.object({
    type: exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools13CodeToolType$outboundSchema,
    properties: z.record(z.any()),
    required: z.array(z.string()),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function streamRunAgentAgentToolInputRunParametersToJSON(streamRunAgentAgentToolInputRunParameters) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunParameters$outboundSchema.parse(streamRunAgentAgentToolInputRunParameters));
}
/** @internal */
exports.AgentToolInputRunLanguage$outboundSchema = z.nativeEnum(exports.AgentToolInputRunLanguage);
/** @internal */
exports.AgentToolInputRunCodeTool$outboundSchema = z.object({
    parameters: z.lazy(() => exports.StreamRunAgentAgentToolInputRunParameters$outboundSchema).optional(),
    language: exports.AgentToolInputRunLanguage$outboundSchema,
    code: z.string(),
});
function agentToolInputRunCodeToolToJSON(agentToolInputRunCodeTool) {
    return JSON.stringify(exports.AgentToolInputRunCodeTool$outboundSchema.parse(agentToolInputRunCodeTool));
}
/** @internal */
exports.AgentToolInputRunCodeToolRun$outboundSchema = z.object({
    type: z.literal("code"),
    key: z.string(),
    id: z.string().optional(),
    displayName: z.string().optional(),
    description: z.string(),
    codeTool: z.lazy(() => exports.AgentToolInputRunCodeTool$outboundSchema),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        codeTool: "code_tool",
        requiresApproval: "requires_approval",
    });
});
function agentToolInputRunCodeToolRunToJSON(agentToolInputRunCodeToolRun) {
    return JSON.stringify(exports.AgentToolInputRunCodeToolRun$outboundSchema.parse(agentToolInputRunCodeToolRun));
}
/** @internal */
exports.AgentToolInputRunMethod$outboundSchema = z.nativeEnum(exports.AgentToolInputRunMethod);
/** @internal */
exports.StreamRunAgentHeaders2$outboundSchema = z.object({
    value: z.string(),
    encrypted: z.boolean().default(false),
});
function streamRunAgentHeaders2ToJSON(streamRunAgentHeaders2) {
    return JSON.stringify(exports.StreamRunAgentHeaders2$outboundSchema.parse(streamRunAgentHeaders2));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunHeaders$outboundSchema = z.union([z.lazy(() => exports.StreamRunAgentHeaders2$outboundSchema), z.string()]);
function streamRunAgentAgentToolInputRunHeadersToJSON(streamRunAgentAgentToolInputRunHeaders) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunHeaders$outboundSchema.parse(streamRunAgentAgentToolInputRunHeaders));
}
/** @internal */
exports.AgentToolInputRunBlueprint$outboundSchema = z.object({
    url: z.string(),
    method: exports.AgentToolInputRunMethod$outboundSchema,
    headers: z.record(z.union([z.lazy(() => exports.StreamRunAgentHeaders2$outboundSchema), z.string()])).optional(),
    body: z.record(z.any()).optional(),
});
function agentToolInputRunBlueprintToJSON(agentToolInputRunBlueprint) {
    return JSON.stringify(exports.AgentToolInputRunBlueprint$outboundSchema.parse(agentToolInputRunBlueprint));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType$outboundSchema = z.nativeEnum(exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType);
/** @internal */
exports.AgentToolInputRunDefaultValue$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function agentToolInputRunDefaultValueToJSON(agentToolInputRunDefaultValue) {
    return JSON.stringify(exports.AgentToolInputRunDefaultValue$outboundSchema.parse(agentToolInputRunDefaultValue));
}
/** @internal */
exports.AgentToolInputRunArguments$outboundSchema = z.object({
    type: exports.StreamRunAgentAgentToolInputRunAgentsRequestRequestBodySettingsTools12HttpType$outboundSchema,
    description: z.string(),
    sendToModel: z.boolean().default(true),
    defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sendToModel: "send_to_model",
        defaultValue: "default_value",
    });
});
function agentToolInputRunArgumentsToJSON(agentToolInputRunArguments) {
    return JSON.stringify(exports.AgentToolInputRunArguments$outboundSchema.parse(agentToolInputRunArguments));
}
/** @internal */
exports.AgentToolInputRunHttp$outboundSchema = z.object({
    blueprint: z.lazy(() => exports.AgentToolInputRunBlueprint$outboundSchema),
    arguments: z.record(z.lazy(() => exports.AgentToolInputRunArguments$outboundSchema))
        .optional(),
});
function agentToolInputRunHttpToJSON(agentToolInputRunHttp) {
    return JSON.stringify(exports.AgentToolInputRunHttp$outboundSchema.parse(agentToolInputRunHttp));
}
/** @internal */
exports.AgentToolInputRunHTTPToolRun$outboundSchema = z.object({
    type: z.literal("http"),
    key: z.string(),
    id: z.string().optional(),
    displayName: z.string().optional(),
    description: z.string(),
    http: z.lazy(() => exports.AgentToolInputRunHttp$outboundSchema),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        requiresApproval: "requires_approval",
    });
});
function agentToolInputRunHTTPToolRunToJSON(agentToolInputRunHTTPToolRun) {
    return JSON.stringify(exports.AgentToolInputRunHTTPToolRun$outboundSchema.parse(agentToolInputRunHTTPToolRun));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunCurrentDateTool$outboundSchema = z.object({
    type: z.literal("current_date"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunCurrentDateToolToJSON(streamRunAgentAgentToolInputRunCurrentDateTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunCurrentDateTool$outboundSchema.parse(streamRunAgentAgentToolInputRunCurrentDateTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunQueryKnowledgeBaseTool$outboundSchema = z.object({
    type: z.literal("query_knowledge_base"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunQueryKnowledgeBaseToolToJSON(streamRunAgentAgentToolInputRunQueryKnowledgeBaseTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunQueryKnowledgeBaseTool$outboundSchema.parse(streamRunAgentAgentToolInputRunQueryKnowledgeBaseTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema = z.object({
    type: z.literal("retrieve_knowledge_bases"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunRetrieveKnowledgeBasesToolToJSON(streamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema
        .parse(streamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunDeleteMemoryDocumentTool$outboundSchema = z.object({
    type: z.literal("delete_memory_document"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunDeleteMemoryDocumentToolToJSON(streamRunAgentAgentToolInputRunDeleteMemoryDocumentTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunDeleteMemoryDocumentTool$outboundSchema
        .parse(streamRunAgentAgentToolInputRunDeleteMemoryDocumentTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunRetrieveMemoryStoresTool$outboundSchema = z.object({
    type: z.literal("retrieve_memory_stores"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunRetrieveMemoryStoresToolToJSON(streamRunAgentAgentToolInputRunRetrieveMemoryStoresTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunRetrieveMemoryStoresTool$outboundSchema
        .parse(streamRunAgentAgentToolInputRunRetrieveMemoryStoresTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunWriteMemoryStoreTool$outboundSchema = z.object({
    type: z.literal("write_memory_store"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunWriteMemoryStoreToolToJSON(streamRunAgentAgentToolInputRunWriteMemoryStoreTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunWriteMemoryStoreTool$outboundSchema.parse(streamRunAgentAgentToolInputRunWriteMemoryStoreTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunQueryMemoryStoreTool$outboundSchema = z.object({
    type: z.literal("query_memory_store"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunQueryMemoryStoreToolToJSON(streamRunAgentAgentToolInputRunQueryMemoryStoreTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunQueryMemoryStoreTool$outboundSchema.parse(streamRunAgentAgentToolInputRunQueryMemoryStoreTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunRetrieveAgentsTool$outboundSchema = z.object({
    type: z.literal("retrieve_agents"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunRetrieveAgentsToolToJSON(streamRunAgentAgentToolInputRunRetrieveAgentsTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunRetrieveAgentsTool$outboundSchema.parse(streamRunAgentAgentToolInputRunRetrieveAgentsTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunCallSubAgentTool$outboundSchema = z.object({
    type: z.literal("call_sub_agent"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunCallSubAgentToolToJSON(streamRunAgentAgentToolInputRunCallSubAgentTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunCallSubAgentTool$outboundSchema.parse(streamRunAgentAgentToolInputRunCallSubAgentTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunWebScraperTool$outboundSchema = z.object({
    type: z.literal("web_scraper"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunWebScraperToolToJSON(streamRunAgentAgentToolInputRunWebScraperTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunWebScraperTool$outboundSchema.parse(streamRunAgentAgentToolInputRunWebScraperTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRunGoogleSearchTool$outboundSchema = z.object({
    type: z.literal("google_search"),
    requiresApproval: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requiresApproval: "requires_approval",
    });
});
function streamRunAgentAgentToolInputRunGoogleSearchToolToJSON(streamRunAgentAgentToolInputRunGoogleSearchTool) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRunGoogleSearchTool$outboundSchema.parse(streamRunAgentAgentToolInputRunGoogleSearchTool));
}
/** @internal */
exports.StreamRunAgentAgentToolInputRun$outboundSchema = z.union([
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunGoogleSearchTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunWebScraperTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunCallSubAgentTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveAgentsTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunQueryMemoryStoreTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunWriteMemoryStoreTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveMemoryStoresTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunDeleteMemoryDocumentTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunQueryKnowledgeBaseTool$outboundSchema),
    z.lazy(() => exports.StreamRunAgentAgentToolInputRunCurrentDateTool$outboundSchema),
    z.lazy(() => exports.AgentToolInputRunHTTPToolRun$outboundSchema),
    z.lazy(() => exports.AgentToolInputRunCodeToolRun$outboundSchema),
    z.lazy(() => exports.AgentToolInputRunFunctionToolRun$outboundSchema),
    z.lazy(() => exports.AgentToolInputRunJSONSchemaToolRun$outboundSchema),
    z.lazy(() => exports.AgentToolInputRunMCPToolRun$outboundSchema),
]);
function streamRunAgentAgentToolInputRunToJSON(streamRunAgentAgentToolInputRun) {
    return JSON.stringify(exports.StreamRunAgentAgentToolInputRun$outboundSchema.parse(streamRunAgentAgentToolInputRun));
}
/** @internal */
exports.StreamRunAgentToolApprovalRequired$outboundSchema = z.nativeEnum(exports.StreamRunAgentToolApprovalRequired);
/** @internal */
exports.StreamRunAgentExecuteOn$outboundSchema = z.nativeEnum(exports.StreamRunAgentExecuteOn);
/** @internal */
exports.StreamRunAgentEvaluators$outboundSchema = z.object({
    id: z.string(),
    sampleRate: z.number().default(50),
    executeOn: exports.StreamRunAgentExecuteOn$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sampleRate: "sample_rate",
        executeOn: "execute_on",
    });
});
function streamRunAgentEvaluatorsToJSON(streamRunAgentEvaluators) {
    return JSON.stringify(exports.StreamRunAgentEvaluators$outboundSchema.parse(streamRunAgentEvaluators));
}
/** @internal */
exports.StreamRunAgentAgentsExecuteOn$outboundSchema = z.nativeEnum(exports.StreamRunAgentAgentsExecuteOn);
/** @internal */
exports.StreamRunAgentGuardrails$outboundSchema = z.object({
    id: z.string(),
    sampleRate: z.number().default(50),
    executeOn: exports.StreamRunAgentAgentsExecuteOn$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sampleRate: "sample_rate",
        executeOn: "execute_on",
    });
});
function streamRunAgentGuardrailsToJSON(streamRunAgentGuardrails) {
    return JSON.stringify(exports.StreamRunAgentGuardrails$outboundSchema.parse(streamRunAgentGuardrails));
}
/** @internal */
exports.StreamRunAgentSettings$outboundSchema = z.object({
    tools: z.array(z.union([
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunGoogleSearchTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunWebScraperTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunCallSubAgentTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveAgentsTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunQueryMemoryStoreTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunWriteMemoryStoreTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveMemoryStoresTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunDeleteMemoryDocumentTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunRetrieveKnowledgeBasesTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunQueryKnowledgeBaseTool$outboundSchema),
        z.lazy(() => exports.StreamRunAgentAgentToolInputRunCurrentDateTool$outboundSchema),
        z.lazy(() => exports.AgentToolInputRunHTTPToolRun$outboundSchema),
        z.lazy(() => exports.AgentToolInputRunCodeToolRun$outboundSchema),
        z.lazy(() => exports.AgentToolInputRunFunctionToolRun$outboundSchema),
        z.lazy(() => exports.AgentToolInputRunJSONSchemaToolRun$outboundSchema),
        z.lazy(() => exports.AgentToolInputRunMCPToolRun$outboundSchema),
    ])).optional(),
    toolApprovalRequired: exports.StreamRunAgentToolApprovalRequired$outboundSchema
        .default("none"),
    maxIterations: z.number().int().default(100),
    maxExecutionTime: z.number().int().default(600),
    maxCost: z.number().default(0),
    evaluators: z.array(z.lazy(() => exports.StreamRunAgentEvaluators$outboundSchema))
        .optional(),
    guardrails: z.array(z.lazy(() => exports.StreamRunAgentGuardrails$outboundSchema))
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        toolApprovalRequired: "tool_approval_required",
        maxIterations: "max_iterations",
        maxExecutionTime: "max_execution_time",
        maxCost: "max_cost",
    });
});
function streamRunAgentSettingsToJSON(streamRunAgentSettings) {
    return JSON.stringify(exports.StreamRunAgentSettings$outboundSchema.parse(streamRunAgentSettings));
}
/** @internal */
exports.StreamRunAgentRequestBody$outboundSchema = z.object({
    key: z.string(),
    taskId: z.string().optional(),
    model: z.union([
        z.lazy(() => exports.StreamRunAgentModelConfiguration2$outboundSchema),
        z.string(),
    ]),
    fallbackModels: z.array(z.union([
        z.lazy(() => exports.StreamRunAgentFallbackModelConfiguration2$outboundSchema),
        z.string(),
    ])).optional(),
    role: z.string(),
    instructions: z.string(),
    message: z.lazy(() => exports.StreamRunAgentA2AMessage$outboundSchema),
    variables: z.record(z.any()).optional(),
    identity: z.lazy(() => exports.StreamRunAgentIdentity$outboundSchema).optional(),
    contact: z.lazy(() => exports.StreamRunAgentContact$outboundSchema).optional(),
    thread: z.lazy(() => exports.StreamRunAgentThread$outboundSchema).optional(),
    memory: z.lazy(() => exports.StreamRunAgentMemory$outboundSchema).optional(),
    path: z.string(),
    description: z.string().optional(),
    systemPrompt: z.string().optional(),
    memoryStores: z.array(z.string()).optional(),
    knowledgeBases: z.array(z.lazy(() => exports.StreamRunAgentKnowledgeBases$outboundSchema)).optional(),
    teamOfAgents: z.array(z.lazy(() => exports.StreamRunAgentTeamOfAgents$outboundSchema))
        .optional(),
    settings: z.lazy(() => exports.StreamRunAgentSettings$outboundSchema),
    metadata: z.record(z.any()).optional(),
    streamTimeoutSeconds: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        taskId: "task_id",
        fallbackModels: "fallback_models",
        systemPrompt: "system_prompt",
        memoryStores: "memory_stores",
        knowledgeBases: "knowledge_bases",
        teamOfAgents: "team_of_agents",
        streamTimeoutSeconds: "stream_timeout_seconds",
    });
});
function streamRunAgentRequestBodyToJSON(streamRunAgentRequestBody) {
    return JSON.stringify(exports.StreamRunAgentRequestBody$outboundSchema.parse(streamRunAgentRequestBody));
}
/** @internal */
exports.StreamRunAgentData$inboundSchema = z.union([
    components.AgentExecutionStartedStreamingEvent$inboundSchema,
    components.AgentStartedStreamingEvent$inboundSchema,
    components.AgentThoughtStreamingEvent$inboundSchema,
    components.AgentInactiveStreamingEvent$inboundSchema,
    components.AgentErroredStreamingEvent$inboundSchema,
    components.ActionReviewRequestedStreamingEvent$inboundSchema,
    components.ActionReviewedStreamingEvent$inboundSchema,
    components.ExecutionReviewRequiredStreamingEvent$inboundSchema,
    components.ExecutionReviewedStreamingEvent$inboundSchema,
    components.ExecutionNamedStreamingEvent$inboundSchema,
    components.AgentHandedOffStreamingEvent$inboundSchema,
    components.AgentMessageCreatedStreamingEvent$inboundSchema,
    components.ToolExecutionStartedStreamingEvent$inboundSchema,
    components.ToolExecutionFinishedStreamingEvent$inboundSchema,
    components.ToolExecutionFailedStreamingEvent$inboundSchema,
    components.TimeoutStreamingEvent$inboundSchema,
    components.ErrorStreamingEvent$inboundSchema,
]);
function streamRunAgentDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StreamRunAgentData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StreamRunAgentData' from JSON`);
}
/** @internal */
exports.StreamRunAgentResponseBody$inboundSchema = z.object({
    data: z.string().transform((v, ctx) => {
        try {
            return JSON.parse(v);
        }
        catch (err) {
            ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
            return z.NEVER;
        }
    }).pipe(z.union([
        components.AgentExecutionStartedStreamingEvent$inboundSchema,
        components.AgentStartedStreamingEvent$inboundSchema,
        components.AgentThoughtStreamingEvent$inboundSchema,
        components.AgentInactiveStreamingEvent$inboundSchema,
        components.AgentErroredStreamingEvent$inboundSchema,
        components.ActionReviewRequestedStreamingEvent$inboundSchema,
        components.ActionReviewedStreamingEvent$inboundSchema,
        components.ExecutionReviewRequiredStreamingEvent$inboundSchema,
        components.ExecutionReviewedStreamingEvent$inboundSchema,
        components.ExecutionNamedStreamingEvent$inboundSchema,
        components.AgentHandedOffStreamingEvent$inboundSchema,
        components.AgentMessageCreatedStreamingEvent$inboundSchema,
        components.ToolExecutionStartedStreamingEvent$inboundSchema,
        components.ToolExecutionFinishedStreamingEvent$inboundSchema,
        components.ToolExecutionFailedStreamingEvent$inboundSchema,
        components.TimeoutStreamingEvent$inboundSchema,
        components.ErrorStreamingEvent$inboundSchema,
    ])),
});
function streamRunAgentResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StreamRunAgentResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StreamRunAgentResponseBody' from JSON`);
}
//# sourceMappingURL=streamrunagent.js.map