"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.GetAgentResponse$inboundSchema = exports.Status$inboundSchema = exports.GetAgentResponsePendingToolCalls$inboundSchema = exports.GetAgentResponseFunction$inboundSchema = exports.GetAgentResponseType$inboundSchema = exports.GetAgentResponseFinishReason$inboundSchema = exports.GetAgentResponseUsage$inboundSchema = exports.GetAgentResponseCompletionTokensDetails$inboundSchema = exports.GetAgentResponsePromptTokensDetails$inboundSchema = exports.Status = exports.GetAgentResponseType = exports.GetAgentResponseFinishReason = void 0;
exports.getAgentResponsePromptTokensDetailsFromJSON = getAgentResponsePromptTokensDetailsFromJSON;
exports.getAgentResponseCompletionTokensDetailsFromJSON = getAgentResponseCompletionTokensDetailsFromJSON;
exports.getAgentResponseUsageFromJSON = getAgentResponseUsageFromJSON;
exports.getAgentResponseFunctionFromJSON = getAgentResponseFunctionFromJSON;
exports.getAgentResponsePendingToolCallsFromJSON = getAgentResponsePendingToolCallsFromJSON;
exports.getAgentResponseFromJSON = getAgentResponseFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const agentresponsemessage_js_1 = require("./agentresponsemessage.js");
const telemetry_js_1 = require("./telemetry.js");
/**
 * The reason why the agent stopped generating
 */
exports.GetAgentResponseFinishReason = {
    Stop: "stop",
    Length: "length",
    ToolCalls: "tool_calls",
    ContentFilter: "content_filter",
    FunctionCall: "function_call",
    MaxIterations: "max_iterations",
    MaxTime: "max_time",
};
exports.GetAgentResponseType = {
    Function: "function",
};
/**
 * Current status of the agent response
 */
exports.Status = {
    InProgress: "in_progress",
    Completed: "completed",
    Failed: "failed",
};
/** @internal */
exports.GetAgentResponsePromptTokensDetails$inboundSchema = z.object({
    cached_tokens: z.nullable(z.number().int()).optional(),
    cache_creation_tokens: z.nullable(z.number().int()).optional(),
    audio_tokens: z.nullable(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cached_tokens": "cachedTokens",
        "cache_creation_tokens": "cacheCreationTokens",
        "audio_tokens": "audioTokens",
    });
});
function getAgentResponsePromptTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponsePromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponsePromptTokensDetails' from JSON`);
}
/** @internal */
exports.GetAgentResponseCompletionTokensDetails$inboundSchema = z.object({
    reasoning_tokens: z.nullable(z.number()).optional(),
    accepted_prediction_tokens: z.nullable(z.number()).optional(),
    rejected_prediction_tokens: z.nullable(z.number()).optional(),
    audio_tokens: z.nullable(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "reasoning_tokens": "reasoningTokens",
        "accepted_prediction_tokens": "acceptedPredictionTokens",
        "rejected_prediction_tokens": "rejectedPredictionTokens",
        "audio_tokens": "audioTokens",
    });
});
function getAgentResponseCompletionTokensDetailsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponseCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponseCompletionTokensDetails' from JSON`);
}
/** @internal */
exports.GetAgentResponseUsage$inboundSchema = z.object({
    completion_tokens: z.number().optional(),
    prompt_tokens: z.number().optional(),
    total_tokens: z.number().optional(),
    prompt_tokens_details: z.nullable(z.lazy(() => exports.GetAgentResponsePromptTokensDetails$inboundSchema)).optional(),
    completion_tokens_details: z.nullable(z.lazy(() => exports.GetAgentResponseCompletionTokensDetails$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "completion_tokens": "completionTokens",
        "prompt_tokens": "promptTokens",
        "total_tokens": "totalTokens",
        "prompt_tokens_details": "promptTokensDetails",
        "completion_tokens_details": "completionTokensDetails",
    });
});
function getAgentResponseUsageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponseUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponseUsage' from JSON`);
}
/** @internal */
exports.GetAgentResponseFinishReason$inboundSchema = z.nativeEnum(exports.GetAgentResponseFinishReason);
/** @internal */
exports.GetAgentResponseType$inboundSchema = z.nativeEnum(exports.GetAgentResponseType);
/** @internal */
exports.GetAgentResponseFunction$inboundSchema = z.object({
    name: z.string().optional(),
    arguments: z.string().optional(),
});
function getAgentResponseFunctionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponseFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponseFunction' from JSON`);
}
/** @internal */
exports.GetAgentResponsePendingToolCalls$inboundSchema = z.object({
    id: z.string(),
    type: exports.GetAgentResponseType$inboundSchema,
    function: z.lazy(() => exports.GetAgentResponseFunction$inboundSchema),
});
function getAgentResponsePendingToolCallsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponsePendingToolCalls$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponsePendingToolCalls' from JSON`);
}
/** @internal */
exports.Status$inboundSchema = z
    .nativeEnum(exports.Status);
/** @internal */
exports.GetAgentResponse$inboundSchema = z.object({
    _id: z.string(),
    task_id: z.string(),
    output: z.array(agentresponsemessage_js_1.AgentResponseMessage$inboundSchema),
    created_at: z.string(),
    model: z.string(),
    usage: z.nullable(z.lazy(() => exports.GetAgentResponseUsage$inboundSchema))
        .optional(),
    finish_reason: exports.GetAgentResponseFinishReason$inboundSchema.optional(),
    pending_tool_calls: z.array(z.lazy(() => exports.GetAgentResponsePendingToolCalls$inboundSchema)).optional(),
    telemetry: telemetry_js_1.Telemetry$inboundSchema.optional(),
    status: exports.Status$inboundSchema,
    error: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "task_id": "taskId",
        "created_at": "createdAt",
        "finish_reason": "finishReason",
        "pending_tool_calls": "pendingToolCalls",
    });
});
function getAgentResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetAgentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAgentResponse' from JSON`);
}
//# sourceMappingURL=getagentresponse.js.map