"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.CreateTranscriptionResponseBody$inboundSchema = exports.CreateTranscriptionResponseBody1$inboundSchema = exports.CreateTranscriptionResponseBody2$inboundSchema = exports.Segments$inboundSchema = exports.Words$inboundSchema = exports.CreateTranscriptionRequestBody$outboundSchema = exports.CreateTranscriptionFile$outboundSchema = exports.CreateTranscriptionOrq$outboundSchema = exports.CreateTranscriptionRouterAudioTranscriptionsTimeout$outboundSchema = exports.CreateTranscriptionRouterAudioTranscriptionsLoadBalancer$outboundSchema = exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptions1$outboundSchema = exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsModels$outboundSchema = exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType$outboundSchema = exports.CreateTranscriptionRouterAudioTranscriptionsRetry$outboundSchema = exports.CreateTranscriptionRouterAudioTranscriptionsFallbacks$outboundSchema = exports.CreateTranscriptionTimeout$outboundSchema = exports.CreateTranscriptionLoadBalancer$outboundSchema = exports.CreateTranscriptionLoadBalancer1$outboundSchema = exports.CreateTranscriptionLoadBalancerModels$outboundSchema = exports.CreateTranscriptionLoadBalancerType$outboundSchema = exports.CreateTranscriptionRetry$outboundSchema = exports.CreateTranscriptionFallbacks$outboundSchema = exports.TimestampGranularities$outboundSchema = exports.TimestampsGranularity$outboundSchema = exports.CreateTranscriptionResponseFormat$outboundSchema = exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType = exports.CreateTranscriptionLoadBalancerType = exports.TimestampGranularities = exports.TimestampsGranularity = exports.CreateTranscriptionResponseFormat = void 0;
exports.createTranscriptionFallbacksToJSON = createTranscriptionFallbacksToJSON;
exports.createTranscriptionRetryToJSON = createTranscriptionRetryToJSON;
exports.createTranscriptionLoadBalancerModelsToJSON = createTranscriptionLoadBalancerModelsToJSON;
exports.createTranscriptionLoadBalancer1ToJSON = createTranscriptionLoadBalancer1ToJSON;
exports.createTranscriptionLoadBalancerToJSON = createTranscriptionLoadBalancerToJSON;
exports.createTranscriptionTimeoutToJSON = createTranscriptionTimeoutToJSON;
exports.createTranscriptionRouterAudioTranscriptionsFallbacksToJSON = createTranscriptionRouterAudioTranscriptionsFallbacksToJSON;
exports.createTranscriptionRouterAudioTranscriptionsRetryToJSON = createTranscriptionRouterAudioTranscriptionsRetryToJSON;
exports.createTranscriptionLoadBalancerRouterAudioTranscriptionsModelsToJSON = createTranscriptionLoadBalancerRouterAudioTranscriptionsModelsToJSON;
exports.createTranscriptionLoadBalancerRouterAudioTranscriptions1ToJSON = createTranscriptionLoadBalancerRouterAudioTranscriptions1ToJSON;
exports.createTranscriptionRouterAudioTranscriptionsLoadBalancerToJSON = createTranscriptionRouterAudioTranscriptionsLoadBalancerToJSON;
exports.createTranscriptionRouterAudioTranscriptionsTimeoutToJSON = createTranscriptionRouterAudioTranscriptionsTimeoutToJSON;
exports.createTranscriptionOrqToJSON = createTranscriptionOrqToJSON;
exports.createTranscriptionFileToJSON = createTranscriptionFileToJSON;
exports.createTranscriptionRequestBodyToJSON = createTranscriptionRequestBodyToJSON;
exports.wordsFromJSON = wordsFromJSON;
exports.segmentsFromJSON = segmentsFromJSON;
exports.createTranscriptionResponseBody2FromJSON = createTranscriptionResponseBody2FromJSON;
exports.createTranscriptionResponseBody1FromJSON = createTranscriptionResponseBody1FromJSON;
exports.createTranscriptionResponseBodyFromJSON = createTranscriptionResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const blobs_js_1 = require("../../types/blobs.js");
const components = __importStar(require("../components/index.js"));
/**
 * The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt.
 */
exports.CreateTranscriptionResponseFormat = {
    Json: "json",
    Text: "text",
    Srt: "srt",
    VerboseJson: "verbose_json",
    Vtt: "vtt",
};
/**
 * The granularity of the timestamps in the transcription. Word provides word-level timestamps and character provides character-level timestamps per word.
 */
exports.TimestampsGranularity = {
    None: "none",
    Word: "word",
    Character: "character",
};
exports.TimestampGranularities = {
    Word: "word",
    Segment: "segment",
};
exports.CreateTranscriptionLoadBalancerType = {
    WeightBased: "weight_based",
};
exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType = {
    WeightBased: "weight_based",
};
/** @internal */
exports.CreateTranscriptionResponseFormat$outboundSchema = z.nativeEnum(exports.CreateTranscriptionResponseFormat);
/** @internal */
exports.TimestampsGranularity$outboundSchema = z.nativeEnum(exports.TimestampsGranularity);
/** @internal */
exports.TimestampGranularities$outboundSchema = z.nativeEnum(exports.TimestampGranularities);
/** @internal */
exports.CreateTranscriptionFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createTranscriptionFallbacksToJSON(createTranscriptionFallbacks) {
    return JSON.stringify(exports.CreateTranscriptionFallbacks$outboundSchema.parse(createTranscriptionFallbacks));
}
/** @internal */
exports.CreateTranscriptionRetry$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 createTranscriptionRetryToJSON(createTranscriptionRetry) {
    return JSON.stringify(exports.CreateTranscriptionRetry$outboundSchema.parse(createTranscriptionRetry));
}
/** @internal */
exports.CreateTranscriptionLoadBalancerType$outboundSchema = z.nativeEnum(exports.CreateTranscriptionLoadBalancerType);
/** @internal */
exports.CreateTranscriptionLoadBalancerModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createTranscriptionLoadBalancerModelsToJSON(createTranscriptionLoadBalancerModels) {
    return JSON.stringify(exports.CreateTranscriptionLoadBalancerModels$outboundSchema.parse(createTranscriptionLoadBalancerModels));
}
/** @internal */
exports.CreateTranscriptionLoadBalancer1$outboundSchema = z.object({
    type: exports.CreateTranscriptionLoadBalancerType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateTranscriptionLoadBalancerModels$outboundSchema)),
});
function createTranscriptionLoadBalancer1ToJSON(createTranscriptionLoadBalancer1) {
    return JSON.stringify(exports.CreateTranscriptionLoadBalancer1$outboundSchema.parse(createTranscriptionLoadBalancer1));
}
/** @internal */
exports.CreateTranscriptionLoadBalancer$outboundSchema = z.lazy(() => exports.CreateTranscriptionLoadBalancer1$outboundSchema);
function createTranscriptionLoadBalancerToJSON(createTranscriptionLoadBalancer) {
    return JSON.stringify(exports.CreateTranscriptionLoadBalancer$outboundSchema.parse(createTranscriptionLoadBalancer));
}
/** @internal */
exports.CreateTranscriptionTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createTranscriptionTimeoutToJSON(createTranscriptionTimeout) {
    return JSON.stringify(exports.CreateTranscriptionTimeout$outboundSchema.parse(createTranscriptionTimeout));
}
/** @internal */
exports.CreateTranscriptionRouterAudioTranscriptionsFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createTranscriptionRouterAudioTranscriptionsFallbacksToJSON(createTranscriptionRouterAudioTranscriptionsFallbacks) {
    return JSON.stringify(exports.CreateTranscriptionRouterAudioTranscriptionsFallbacks$outboundSchema.parse(createTranscriptionRouterAudioTranscriptionsFallbacks));
}
/** @internal */
exports.CreateTranscriptionRouterAudioTranscriptionsRetry$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 createTranscriptionRouterAudioTranscriptionsRetryToJSON(createTranscriptionRouterAudioTranscriptionsRetry) {
    return JSON.stringify(exports.CreateTranscriptionRouterAudioTranscriptionsRetry$outboundSchema.parse(createTranscriptionRouterAudioTranscriptionsRetry));
}
/** @internal */
exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType$outboundSchema = z.nativeEnum(exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType);
/** @internal */
exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsModels$outboundSchema = z.object({
    model: z.string(),
    weight: z.number().default(0.5),
});
function createTranscriptionLoadBalancerRouterAudioTranscriptionsModelsToJSON(createTranscriptionLoadBalancerRouterAudioTranscriptionsModels) {
    return JSON.stringify(exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsModels$outboundSchema
        .parse(createTranscriptionLoadBalancerRouterAudioTranscriptionsModels));
}
/** @internal */
exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptions1$outboundSchema = z.object({
    type: exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsType$outboundSchema,
    models: z.array(z.lazy(() => exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptionsModels$outboundSchema)),
});
function createTranscriptionLoadBalancerRouterAudioTranscriptions1ToJSON(createTranscriptionLoadBalancerRouterAudioTranscriptions1) {
    return JSON.stringify(exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptions1$outboundSchema
        .parse(createTranscriptionLoadBalancerRouterAudioTranscriptions1));
}
/** @internal */
exports.CreateTranscriptionRouterAudioTranscriptionsLoadBalancer$outboundSchema = z.lazy(() => exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptions1$outboundSchema);
function createTranscriptionRouterAudioTranscriptionsLoadBalancerToJSON(createTranscriptionRouterAudioTranscriptionsLoadBalancer) {
    return JSON.stringify(exports.CreateTranscriptionRouterAudioTranscriptionsLoadBalancer$outboundSchema
        .parse(createTranscriptionRouterAudioTranscriptionsLoadBalancer));
}
/** @internal */
exports.CreateTranscriptionRouterAudioTranscriptionsTimeout$outboundSchema = z.object({
    callTimeout: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        callTimeout: "call_timeout",
    });
});
function createTranscriptionRouterAudioTranscriptionsTimeoutToJSON(createTranscriptionRouterAudioTranscriptionsTimeout) {
    return JSON.stringify(exports.CreateTranscriptionRouterAudioTranscriptionsTimeout$outboundSchema.parse(createTranscriptionRouterAudioTranscriptionsTimeout));
}
/** @internal */
exports.CreateTranscriptionOrq$outboundSchema = z.object({
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateTranscriptionRouterAudioTranscriptionsFallbacks$outboundSchema)).optional(),
    retry: z.lazy(() => exports.CreateTranscriptionRouterAudioTranscriptionsRetry$outboundSchema).optional(),
    identity: components.PublicIdentity$outboundSchema.optional(),
    contact: components.PublicContact$outboundSchema.optional(),
    loadBalancer: z.lazy(() => exports.CreateTranscriptionLoadBalancerRouterAudioTranscriptions1$outboundSchema).optional(),
    timeout: z.lazy(() => exports.CreateTranscriptionRouterAudioTranscriptionsTimeout$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        loadBalancer: "load_balancer",
    });
});
function createTranscriptionOrqToJSON(createTranscriptionOrq) {
    return JSON.stringify(exports.CreateTranscriptionOrq$outboundSchema.parse(createTranscriptionOrq));
}
/** @internal */
exports.CreateTranscriptionFile$outboundSchema = z.object({
    fileName: z.string(),
    content: z.union([
        z.instanceof((ReadableStream)),
        z.instanceof(Blob),
        z.instanceof(ArrayBuffer),
        z.instanceof(Uint8Array),
    ]),
});
function createTranscriptionFileToJSON(createTranscriptionFile) {
    return JSON.stringify(exports.CreateTranscriptionFile$outboundSchema.parse(createTranscriptionFile));
}
/** @internal */
exports.CreateTranscriptionRequestBody$outboundSchema = z.object({
    model: z.string(),
    prompt: z.string().optional(),
    enableLogging: z.boolean().default(true),
    diarize: z.boolean().default(false),
    responseFormat: exports.CreateTranscriptionResponseFormat$outboundSchema.optional(),
    tagAudioEvents: z.boolean().default(true),
    numSpeakers: z.number().optional(),
    timestampsGranularity: exports.TimestampsGranularity$outboundSchema.default("word"),
    temperature: z.number().optional(),
    language: z.string().optional(),
    timestampGranularities: z.array(exports.TimestampGranularities$outboundSchema)
        .optional(),
    name: z.string().optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateTranscriptionFallbacks$outboundSchema))
        .optional(),
    retry: z.lazy(() => exports.CreateTranscriptionRetry$outboundSchema).optional(),
    loadBalancer: z.lazy(() => exports.CreateTranscriptionLoadBalancer1$outboundSchema)
        .optional(),
    timeout: z.lazy(() => exports.CreateTranscriptionTimeout$outboundSchema).optional(),
    orq: z.lazy(() => exports.CreateTranscriptionOrq$outboundSchema).optional(),
    file: z.lazy(() => exports.CreateTranscriptionFile$outboundSchema).or(blobs_js_1.blobLikeSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        enableLogging: "enable_logging",
        responseFormat: "response_format",
        tagAudioEvents: "tag_audio_events",
        numSpeakers: "num_speakers",
        timestampsGranularity: "timestamps_granularity",
        timestampGranularities: "timestamp_granularities",
        loadBalancer: "load_balancer",
    });
});
function createTranscriptionRequestBodyToJSON(createTranscriptionRequestBody) {
    return JSON.stringify(exports.CreateTranscriptionRequestBody$outboundSchema.parse(createTranscriptionRequestBody));
}
/** @internal */
exports.Words$inboundSchema = z
    .object({
    word: z.string().optional(),
    start: z.number().optional(),
    end: z.number().optional(),
});
function wordsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Words$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Words' from JSON`);
}
/** @internal */
exports.Segments$inboundSchema = z.object({
    id: z.number(),
    seek: z.number(),
    start: z.number(),
    end: z.number(),
    text: z.string(),
    tokens: z.array(z.number()),
    temperature: z.number(),
    avg_logprob: z.number(),
    compression_ratio: z.number(),
    no_speech_prob: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "avg_logprob": "avgLogprob",
        "compression_ratio": "compressionRatio",
        "no_speech_prob": "noSpeechProb",
    });
});
function segmentsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Segments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Segments' from JSON`);
}
/** @internal */
exports.CreateTranscriptionResponseBody2$inboundSchema = z.object({
    task: z.string().optional(),
    language: z.string().optional(),
    duration: z.number().optional(),
    text: z.string(),
    words: z.array(z.lazy(() => exports.Words$inboundSchema)).optional(),
    segments: z.array(z.lazy(() => exports.Segments$inboundSchema)).optional(),
});
function createTranscriptionResponseBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranscriptionResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranscriptionResponseBody2' from JSON`);
}
/** @internal */
exports.CreateTranscriptionResponseBody1$inboundSchema = z.object({
    text: z.string(),
});
function createTranscriptionResponseBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranscriptionResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranscriptionResponseBody1' from JSON`);
}
/** @internal */
exports.CreateTranscriptionResponseBody$inboundSchema = z.union([
    z.lazy(() => exports.CreateTranscriptionResponseBody1$inboundSchema),
    z.lazy(() => exports.CreateTranscriptionResponseBody2$inboundSchema),
    z.string(),
]);
function createTranscriptionResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateTranscriptionResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateTranscriptionResponseBody' from JSON`);
}
//# sourceMappingURL=createtranscription.js.map