"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.UpdateKnowledgeResponseBodyRetrievalType$outboundSchema = exports.UpdateKnowledgeResponseBodyRetrievalType$inboundSchema = exports.UpdateKnowledgeResponseBodyType$outboundSchema = exports.UpdateKnowledgeResponseBodyType$inboundSchema = exports.UpdateKnowledgeResponseBody2$outboundSchema = exports.UpdateKnowledgeResponseBody2$inboundSchema = exports.UpdateKnowledgeResponseBodyExternalConfig$outboundSchema = exports.UpdateKnowledgeResponseBodyExternalConfig$inboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$outboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$outboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$outboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeType$outboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeType$inboundSchema = exports.UpdateKnowledgeRequest$outboundSchema = exports.UpdateKnowledgeRequest$inboundSchema = exports.UpdateKnowledgeRequestBody$outboundSchema = exports.UpdateKnowledgeRequestBody$inboundSchema = exports.UpdateKnowledgeRequestBody1$outboundSchema = exports.UpdateKnowledgeRequestBody1$inboundSchema = exports.UpdateKnowledgeRequestBodyType$outboundSchema = exports.UpdateKnowledgeRequestBodyType$inboundSchema = exports.RequestBodyExternalConfig$outboundSchema = exports.RequestBodyExternalConfig$inboundSchema = exports.RequestBodyRetrievalSettings$outboundSchema = exports.RequestBodyRetrievalSettings$inboundSchema = exports.RequestBodyAgenticRagConfig$outboundSchema = exports.RequestBodyAgenticRagConfig$inboundSchema = exports.RequestBodyRerankConfig$outboundSchema = exports.RequestBodyRerankConfig$inboundSchema = exports.UpdateKnowledgeRequestBody2$outboundSchema = exports.UpdateKnowledgeRequestBody2$inboundSchema = exports.UpdateKnowledgeRequestBodyKnowledgeType$outboundSchema = exports.UpdateKnowledgeRequestBodyKnowledgeType$inboundSchema = exports.UpdateKnowledgeRequestBodyRetrievalSettings$outboundSchema = exports.UpdateKnowledgeRequestBodyRetrievalSettings$inboundSchema = exports.UpdateKnowledgeRequestBodyAgenticRagConfig$outboundSchema = exports.UpdateKnowledgeRequestBodyAgenticRagConfig$inboundSchema = exports.UpdateKnowledgeRequestBodyRerankConfig$outboundSchema = exports.UpdateKnowledgeRequestBodyRerankConfig$inboundSchema = exports.RequestBodyRetrievalType$outboundSchema = exports.RequestBodyRetrievalType$inboundSchema = exports.UpdateKnowledgeResponseBodyRetrievalType = exports.UpdateKnowledgeResponseBodyType = exports.UpdateKnowledgeResponseBodyKnowledgeType = exports.UpdateKnowledgeRequestBodyType = exports.UpdateKnowledgeRequestBodyKnowledgeType = exports.RequestBodyRetrievalType = void 0;
exports.UpdateKnowledgeResponseBody$outboundSchema = exports.UpdateKnowledgeResponseBody$inboundSchema = exports.UpdateKnowledgeResponseBody1$outboundSchema = exports.UpdateKnowledgeResponseBody1$inboundSchema = exports.UpdateKnowledgeResponseBodyRetrievalSettings$outboundSchema = exports.UpdateKnowledgeResponseBodyRetrievalSettings$inboundSchema = exports.UpdateKnowledgeResponseBodyAgenticRagConfig$outboundSchema = exports.UpdateKnowledgeResponseBodyAgenticRagConfig$inboundSchema = exports.UpdateKnowledgeResponseBodyRerankConfig$outboundSchema = exports.UpdateKnowledgeResponseBodyRerankConfig$inboundSchema = void 0;
exports.updateKnowledgeRequestBodyRerankConfigToJSON = updateKnowledgeRequestBodyRerankConfigToJSON;
exports.updateKnowledgeRequestBodyRerankConfigFromJSON = updateKnowledgeRequestBodyRerankConfigFromJSON;
exports.updateKnowledgeRequestBodyAgenticRagConfigToJSON = updateKnowledgeRequestBodyAgenticRagConfigToJSON;
exports.updateKnowledgeRequestBodyAgenticRagConfigFromJSON = updateKnowledgeRequestBodyAgenticRagConfigFromJSON;
exports.updateKnowledgeRequestBodyRetrievalSettingsToJSON = updateKnowledgeRequestBodyRetrievalSettingsToJSON;
exports.updateKnowledgeRequestBodyRetrievalSettingsFromJSON = updateKnowledgeRequestBodyRetrievalSettingsFromJSON;
exports.updateKnowledgeRequestBody2ToJSON = updateKnowledgeRequestBody2ToJSON;
exports.updateKnowledgeRequestBody2FromJSON = updateKnowledgeRequestBody2FromJSON;
exports.requestBodyRerankConfigToJSON = requestBodyRerankConfigToJSON;
exports.requestBodyRerankConfigFromJSON = requestBodyRerankConfigFromJSON;
exports.requestBodyAgenticRagConfigToJSON = requestBodyAgenticRagConfigToJSON;
exports.requestBodyAgenticRagConfigFromJSON = requestBodyAgenticRagConfigFromJSON;
exports.requestBodyRetrievalSettingsToJSON = requestBodyRetrievalSettingsToJSON;
exports.requestBodyRetrievalSettingsFromJSON = requestBodyRetrievalSettingsFromJSON;
exports.requestBodyExternalConfigToJSON = requestBodyExternalConfigToJSON;
exports.requestBodyExternalConfigFromJSON = requestBodyExternalConfigFromJSON;
exports.updateKnowledgeRequestBody1ToJSON = updateKnowledgeRequestBody1ToJSON;
exports.updateKnowledgeRequestBody1FromJSON = updateKnowledgeRequestBody1FromJSON;
exports.updateKnowledgeRequestBodyToJSON = updateKnowledgeRequestBodyToJSON;
exports.updateKnowledgeRequestBodyFromJSON = updateKnowledgeRequestBodyFromJSON;
exports.updateKnowledgeRequestToJSON = updateKnowledgeRequestToJSON;
exports.updateKnowledgeRequestFromJSON = updateKnowledgeRequestFromJSON;
exports.updateKnowledgeResponseBodyKnowledgeRerankConfigToJSON = updateKnowledgeResponseBodyKnowledgeRerankConfigToJSON;
exports.updateKnowledgeResponseBodyKnowledgeRerankConfigFromJSON = updateKnowledgeResponseBodyKnowledgeRerankConfigFromJSON;
exports.updateKnowledgeResponseBodyKnowledgeAgenticRagConfigToJSON = updateKnowledgeResponseBodyKnowledgeAgenticRagConfigToJSON;
exports.updateKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON = updateKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON;
exports.updateKnowledgeResponseBodyKnowledgeRetrievalSettingsToJSON = updateKnowledgeResponseBodyKnowledgeRetrievalSettingsToJSON;
exports.updateKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON = updateKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON;
exports.updateKnowledgeResponseBodyExternalConfigToJSON = updateKnowledgeResponseBodyExternalConfigToJSON;
exports.updateKnowledgeResponseBodyExternalConfigFromJSON = updateKnowledgeResponseBodyExternalConfigFromJSON;
exports.updateKnowledgeResponseBody2ToJSON = updateKnowledgeResponseBody2ToJSON;
exports.updateKnowledgeResponseBody2FromJSON = updateKnowledgeResponseBody2FromJSON;
exports.updateKnowledgeResponseBodyRerankConfigToJSON = updateKnowledgeResponseBodyRerankConfigToJSON;
exports.updateKnowledgeResponseBodyRerankConfigFromJSON = updateKnowledgeResponseBodyRerankConfigFromJSON;
exports.updateKnowledgeResponseBodyAgenticRagConfigToJSON = updateKnowledgeResponseBodyAgenticRagConfigToJSON;
exports.updateKnowledgeResponseBodyAgenticRagConfigFromJSON = updateKnowledgeResponseBodyAgenticRagConfigFromJSON;
exports.updateKnowledgeResponseBodyRetrievalSettingsToJSON = updateKnowledgeResponseBodyRetrievalSettingsToJSON;
exports.updateKnowledgeResponseBodyRetrievalSettingsFromJSON = updateKnowledgeResponseBodyRetrievalSettingsFromJSON;
exports.updateKnowledgeResponseBody1ToJSON = updateKnowledgeResponseBody1ToJSON;
exports.updateKnowledgeResponseBody1FromJSON = updateKnowledgeResponseBody1FromJSON;
exports.updateKnowledgeResponseBodyToJSON = updateKnowledgeResponseBodyToJSON;
exports.updateKnowledgeResponseBodyFromJSON = updateKnowledgeResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The retrieval type to use for the knowledge base. If not provided, Hybrid Search will be used as a default query strategy.
 */
exports.RequestBodyRetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
exports.UpdateKnowledgeRequestBodyKnowledgeType = {
    Internal: "internal",
};
exports.UpdateKnowledgeRequestBodyType = {
    External: "external",
};
exports.UpdateKnowledgeResponseBodyKnowledgeType = {
    External: "external",
};
exports.UpdateKnowledgeResponseBodyType = {
    Internal: "internal",
};
/**
 * The retrieval type to use for the knowledge base. If not provided, Hybrid Search will be used as a default query strategy.
 */
exports.UpdateKnowledgeResponseBodyRetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
/** @internal */
exports.RequestBodyRetrievalType$inboundSchema = z.nativeEnum(exports.RequestBodyRetrievalType);
/** @internal */
exports.RequestBodyRetrievalType$outboundSchema = exports.RequestBodyRetrievalType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeRequestBodyRerankConfig$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    rerank_threshold: z.number().default(0.5),
    rerank_model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_threshold": "rerankThreshold",
        "rerank_model": "rerankModel",
    });
});
/** @internal */
exports.UpdateKnowledgeRequestBodyRerankConfig$outboundSchema = z.object({
    topK: z.number().int().default(5),
    rerankThreshold: z.number().default(0.5),
    rerankModel: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankThreshold: "rerank_threshold",
        rerankModel: "rerank_model",
    });
});
function updateKnowledgeRequestBodyRerankConfigToJSON(updateKnowledgeRequestBodyRerankConfig) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBodyRerankConfig$outboundSchema.parse(updateKnowledgeRequestBodyRerankConfig));
}
function updateKnowledgeRequestBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBodyRerankConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequestBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.UpdateKnowledgeRequestBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function updateKnowledgeRequestBodyAgenticRagConfigToJSON(updateKnowledgeRequestBodyAgenticRagConfig) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBodyAgenticRagConfig$outboundSchema.parse(updateKnowledgeRequestBodyAgenticRagConfig));
}
function updateKnowledgeRequestBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequestBodyRetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.RequestBodyRetrievalType$inboundSchema.default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeRequestBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeRequestBodyAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "retrieval_type": "retrievalType",
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
/** @internal */
exports.UpdateKnowledgeRequestBodyRetrievalSettings$outboundSchema = z.object({
    retrievalType: exports.RequestBodyRetrievalType$outboundSchema.default("hybrid_search"),
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeRequestBodyRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeRequestBodyAgenticRagConfig$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        retrievalType: "retrieval_type",
        topK: "top_k",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function updateKnowledgeRequestBodyRetrievalSettingsToJSON(updateKnowledgeRequestBodyRetrievalSettings) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBodyRetrievalSettings$outboundSchema.parse(updateKnowledgeRequestBodyRetrievalSettings));
}
function updateKnowledgeRequestBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequestBodyKnowledgeType$inboundSchema = z
    .nativeEnum(exports.UpdateKnowledgeRequestBodyKnowledgeType);
/** @internal */
exports.UpdateKnowledgeRequestBodyKnowledgeType$outboundSchema = exports.UpdateKnowledgeRequestBodyKnowledgeType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeRequestBody2$inboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    embedding_model: z.string().optional(),
    path: z.string().optional(),
    retrieval_settings: z.lazy(() => exports.UpdateKnowledgeRequestBodyRetrievalSettings$inboundSchema).optional(),
    type: exports.UpdateKnowledgeRequestBodyKnowledgeType$inboundSchema.default("internal"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "embedding_model": "embeddingModel",
        "retrieval_settings": "retrievalSettings",
    });
});
/** @internal */
exports.UpdateKnowledgeRequestBody2$outboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    embeddingModel: z.string().optional(),
    path: z.string().optional(),
    retrievalSettings: z.lazy(() => exports.UpdateKnowledgeRequestBodyRetrievalSettings$outboundSchema).optional(),
    type: exports.UpdateKnowledgeRequestBodyKnowledgeType$outboundSchema.default("internal"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        embeddingModel: "embedding_model",
        retrievalSettings: "retrieval_settings",
    });
});
function updateKnowledgeRequestBody2ToJSON(updateKnowledgeRequestBody2) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBody2$outboundSchema.parse(updateKnowledgeRequestBody2));
}
function updateKnowledgeRequestBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBody2' from JSON`);
}
/** @internal */
exports.RequestBodyRerankConfig$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    rerank_threshold: z.number().default(0.5),
    rerank_model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_threshold": "rerankThreshold",
        "rerank_model": "rerankModel",
    });
});
/** @internal */
exports.RequestBodyRerankConfig$outboundSchema = z.object({
    topK: z.number().int().default(5),
    rerankThreshold: z.number().default(0.5),
    rerankModel: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankThreshold: "rerank_threshold",
        rerankModel: "rerank_model",
    });
});
function requestBodyRerankConfigToJSON(requestBodyRerankConfig) {
    return JSON.stringify(exports.RequestBodyRerankConfig$outboundSchema.parse(requestBodyRerankConfig));
}
function requestBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBodyRerankConfig' from JSON`);
}
/** @internal */
exports.RequestBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.RequestBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function requestBodyAgenticRagConfigToJSON(requestBodyAgenticRagConfig) {
    return JSON.stringify(exports.RequestBodyAgenticRagConfig$outboundSchema.parse(requestBodyAgenticRagConfig));
}
function requestBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.RequestBodyRetrievalSettings$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.RequestBodyRerankConfig$inboundSchema))
        .optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.RequestBodyAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
/** @internal */
exports.RequestBodyRetrievalSettings$outboundSchema = z.object({
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.RequestBodyRerankConfig$outboundSchema))
        .optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.RequestBodyAgenticRagConfig$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function requestBodyRetrievalSettingsToJSON(requestBodyRetrievalSettings) {
    return JSON.stringify(exports.RequestBodyRetrievalSettings$outboundSchema.parse(requestBodyRetrievalSettings));
}
function requestBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.RequestBodyExternalConfig$inboundSchema = z.object({
    name: z.string().optional(),
    api_url: z.string().optional(),
    api_key: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
        "api_key": "apiKey",
    });
});
/** @internal */
exports.RequestBodyExternalConfig$outboundSchema = z.object({
    name: z.string().optional(),
    apiUrl: z.string().optional(),
    apiKey: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        apiUrl: "api_url",
        apiKey: "api_key",
    });
});
function requestBodyExternalConfigToJSON(requestBodyExternalConfig) {
    return JSON.stringify(exports.RequestBodyExternalConfig$outboundSchema.parse(requestBodyExternalConfig));
}
function requestBodyExternalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBodyExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBodyExternalConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequestBodyType$inboundSchema = z.nativeEnum(exports.UpdateKnowledgeRequestBodyType);
/** @internal */
exports.UpdateKnowledgeRequestBodyType$outboundSchema = exports.UpdateKnowledgeRequestBodyType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeRequestBody1$inboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    path: z.string().optional(),
    retrieval_settings: z.lazy(() => exports.RequestBodyRetrievalSettings$inboundSchema)
        .optional(),
    external_config: z.lazy(() => exports.RequestBodyExternalConfig$inboundSchema)
        .optional(),
    type: exports.UpdateKnowledgeRequestBodyType$inboundSchema.default("external"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "retrieval_settings": "retrievalSettings",
        "external_config": "externalConfig",
    });
});
/** @internal */
exports.UpdateKnowledgeRequestBody1$outboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    path: z.string().optional(),
    retrievalSettings: z.lazy(() => exports.RequestBodyRetrievalSettings$outboundSchema)
        .optional(),
    externalConfig: z.lazy(() => exports.RequestBodyExternalConfig$outboundSchema)
        .optional(),
    type: exports.UpdateKnowledgeRequestBodyType$outboundSchema.default("external"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        retrievalSettings: "retrieval_settings",
        externalConfig: "external_config",
    });
});
function updateKnowledgeRequestBody1ToJSON(updateKnowledgeRequestBody1) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBody1$outboundSchema.parse(updateKnowledgeRequestBody1));
}
function updateKnowledgeRequestBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBody1' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequestBody$inboundSchema = z.union([
    z.lazy(() => exports.UpdateKnowledgeRequestBody1$inboundSchema),
    z.lazy(() => exports.UpdateKnowledgeRequestBody2$inboundSchema),
]);
/** @internal */
exports.UpdateKnowledgeRequestBody$outboundSchema = z.union([
    z.lazy(() => exports.UpdateKnowledgeRequestBody1$outboundSchema),
    z.lazy(() => exports.UpdateKnowledgeRequestBody2$outboundSchema),
]);
function updateKnowledgeRequestBodyToJSON(updateKnowledgeRequestBody) {
    return JSON.stringify(exports.UpdateKnowledgeRequestBody$outboundSchema.parse(updateKnowledgeRequestBody));
}
function updateKnowledgeRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequestBody' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeRequest$inboundSchema = z.object({
    knowledge_id: z.string(),
    RequestBody: z.union([
        z.lazy(() => exports.UpdateKnowledgeRequestBody1$inboundSchema),
        z.lazy(() => exports.UpdateKnowledgeRequestBody2$inboundSchema),
    ]),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "knowledge_id": "knowledgeId",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.UpdateKnowledgeRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
    requestBody: z.union([
        z.lazy(() => exports.UpdateKnowledgeRequestBody1$outboundSchema),
        z.lazy(() => exports.UpdateKnowledgeRequestBody2$outboundSchema),
    ]),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
        requestBody: "RequestBody",
    });
});
function updateKnowledgeRequestToJSON(updateKnowledgeRequest) {
    return JSON.stringify(exports.UpdateKnowledgeRequest$outboundSchema.parse(updateKnowledgeRequest));
}
function updateKnowledgeRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeRequest' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeType$inboundSchema = z
    .nativeEnum(exports.UpdateKnowledgeResponseBodyKnowledgeType);
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeType$outboundSchema = exports.UpdateKnowledgeResponseBodyKnowledgeType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    rerank_threshold: z.number().default(0.5),
    rerank_model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_threshold": "rerankThreshold",
        "rerank_model": "rerankModel",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$outboundSchema = z.object({
    topK: z.number().int().default(5),
    rerankThreshold: z.number().default(0.5),
    rerankModel: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankThreshold: "rerank_threshold",
        rerankModel: "rerank_model",
    });
});
function updateKnowledgeResponseBodyKnowledgeRerankConfigToJSON(updateKnowledgeResponseBodyKnowledgeRerankConfig) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$outboundSchema.parse(updateKnowledgeResponseBodyKnowledgeRerankConfig));
}
function updateKnowledgeResponseBodyKnowledgeRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyKnowledgeRerankConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function updateKnowledgeResponseBodyKnowledgeAgenticRagConfigToJSON(updateKnowledgeResponseBodyKnowledgeAgenticRagConfig) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$outboundSchema.parse(updateKnowledgeResponseBodyKnowledgeAgenticRagConfig));
}
function updateKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$outboundSchema = z.object({
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeAgenticRagConfig$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function updateKnowledgeResponseBodyKnowledgeRetrievalSettingsToJSON(updateKnowledgeResponseBodyKnowledgeRetrievalSettings) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$outboundSchema.parse(updateKnowledgeResponseBodyKnowledgeRetrievalSettings));
}
function updateKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyExternalConfig$inboundSchema = z.object({
    name: z.string(),
    api_url: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBodyExternalConfig$outboundSchema = z.object({
    name: z.string(),
    apiUrl: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        apiUrl: "api_url",
    });
});
function updateKnowledgeResponseBodyExternalConfigToJSON(updateKnowledgeResponseBodyExternalConfig) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyExternalConfig$outboundSchema.parse(updateKnowledgeResponseBodyExternalConfig));
}
function updateKnowledgeResponseBodyExternalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyExternalConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBody2$inboundSchema = z.object({
    _id: z.string(),
    created: z.string(),
    description: z.string().optional(),
    key: z.string(),
    domain_id: z.string(),
    path: z.string().optional(),
    created_by_id: z.nullable(z.string()).optional(),
    updated_by_id: z.nullable(z.string()).optional(),
    updated: z.string(),
    type: exports.UpdateKnowledgeResponseBodyKnowledgeType$inboundSchema.default("external"),
    retrieval_settings: z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema).optional(),
    external_config: z.lazy(() => exports.UpdateKnowledgeResponseBodyExternalConfig$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "domain_id": "domainId",
        "created_by_id": "createdById",
        "updated_by_id": "updatedById",
        "retrieval_settings": "retrievalSettings",
        "external_config": "externalConfig",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBody2$outboundSchema = z.object({
    id: z.string(),
    created: z.string(),
    description: z.string().optional(),
    key: z.string(),
    domainId: z.string(),
    path: z.string().optional(),
    createdById: z.nullable(z.string()).optional(),
    updatedById: z.nullable(z.string()).optional(),
    updated: z.string(),
    type: exports.UpdateKnowledgeResponseBodyKnowledgeType$outboundSchema.default("external"),
    retrievalSettings: z.lazy(() => exports.UpdateKnowledgeResponseBodyKnowledgeRetrievalSettings$outboundSchema).optional(),
    externalConfig: z.lazy(() => exports.UpdateKnowledgeResponseBodyExternalConfig$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        domainId: "domain_id",
        createdById: "created_by_id",
        updatedById: "updated_by_id",
        retrievalSettings: "retrieval_settings",
        externalConfig: "external_config",
    });
});
function updateKnowledgeResponseBody2ToJSON(updateKnowledgeResponseBody2) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBody2$outboundSchema.parse(updateKnowledgeResponseBody2));
}
function updateKnowledgeResponseBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBody2' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyType$inboundSchema = z.nativeEnum(exports.UpdateKnowledgeResponseBodyType);
/** @internal */
exports.UpdateKnowledgeResponseBodyType$outboundSchema = exports.UpdateKnowledgeResponseBodyType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeResponseBodyRetrievalType$inboundSchema = z
    .nativeEnum(exports.UpdateKnowledgeResponseBodyRetrievalType);
/** @internal */
exports.UpdateKnowledgeResponseBodyRetrievalType$outboundSchema = exports.UpdateKnowledgeResponseBodyRetrievalType$inboundSchema;
/** @internal */
exports.UpdateKnowledgeResponseBodyRerankConfig$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    rerank_threshold: z.number().default(0.5),
    rerank_model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_threshold": "rerankThreshold",
        "rerank_model": "rerankModel",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBodyRerankConfig$outboundSchema = z.object({
    topK: z.number().int().default(5),
    rerankThreshold: z.number().default(0.5),
    rerankModel: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankThreshold: "rerank_threshold",
        rerankModel: "rerank_model",
    });
});
function updateKnowledgeResponseBodyRerankConfigToJSON(updateKnowledgeResponseBodyRerankConfig) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyRerankConfig$outboundSchema.parse(updateKnowledgeResponseBodyRerankConfig));
}
function updateKnowledgeResponseBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyRerankConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.UpdateKnowledgeResponseBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function updateKnowledgeResponseBodyAgenticRagConfigToJSON(updateKnowledgeResponseBodyAgenticRagConfig) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyAgenticRagConfig$outboundSchema.parse(updateKnowledgeResponseBodyAgenticRagConfig));
}
function updateKnowledgeResponseBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBodyRetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.UpdateKnowledgeResponseBodyRetrievalType$inboundSchema
        .default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "retrieval_type": "retrievalType",
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBodyRetrievalSettings$outboundSchema = z.object({
    retrievalType: exports.UpdateKnowledgeResponseBodyRetrievalType$outboundSchema
        .default("hybrid_search"),
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.UpdateKnowledgeResponseBodyAgenticRagConfig$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        retrievalType: "retrieval_type",
        topK: "top_k",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function updateKnowledgeResponseBodyRetrievalSettingsToJSON(updateKnowledgeResponseBodyRetrievalSettings) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBodyRetrievalSettings$outboundSchema.parse(updateKnowledgeResponseBodyRetrievalSettings));
}
function updateKnowledgeResponseBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBody1$inboundSchema = z.object({
    _id: z.string(),
    created: z.string(),
    description: z.string().optional(),
    key: z.string(),
    domain_id: z.string(),
    path: z.string().optional(),
    created_by_id: z.nullable(z.string()).optional(),
    updated_by_id: z.nullable(z.string()).optional(),
    updated: z.string(),
    type: exports.UpdateKnowledgeResponseBodyType$inboundSchema.default("internal"),
    retrieval_settings: z.lazy(() => exports.UpdateKnowledgeResponseBodyRetrievalSettings$inboundSchema).optional(),
    model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "domain_id": "domainId",
        "created_by_id": "createdById",
        "updated_by_id": "updatedById",
        "retrieval_settings": "retrievalSettings",
    });
});
/** @internal */
exports.UpdateKnowledgeResponseBody1$outboundSchema = z.object({
    id: z.string(),
    created: z.string(),
    description: z.string().optional(),
    key: z.string(),
    domainId: z.string(),
    path: z.string().optional(),
    createdById: z.nullable(z.string()).optional(),
    updatedById: z.nullable(z.string()).optional(),
    updated: z.string(),
    type: exports.UpdateKnowledgeResponseBodyType$outboundSchema.default("internal"),
    retrievalSettings: z.lazy(() => exports.UpdateKnowledgeResponseBodyRetrievalSettings$outboundSchema).optional(),
    model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        domainId: "domain_id",
        createdById: "created_by_id",
        updatedById: "updated_by_id",
        retrievalSettings: "retrieval_settings",
    });
});
function updateKnowledgeResponseBody1ToJSON(updateKnowledgeResponseBody1) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBody1$outboundSchema.parse(updateKnowledgeResponseBody1));
}
function updateKnowledgeResponseBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBody1' from JSON`);
}
/** @internal */
exports.UpdateKnowledgeResponseBody$inboundSchema = z.union([
    z.lazy(() => exports.UpdateKnowledgeResponseBody1$inboundSchema),
    z.lazy(() => exports.UpdateKnowledgeResponseBody2$inboundSchema),
]);
/** @internal */
exports.UpdateKnowledgeResponseBody$outboundSchema = z.union([
    z.lazy(() => exports.UpdateKnowledgeResponseBody1$outboundSchema),
    z.lazy(() => exports.UpdateKnowledgeResponseBody2$outboundSchema),
]);
function updateKnowledgeResponseBodyToJSON(updateKnowledgeResponseBody) {
    return JSON.stringify(exports.UpdateKnowledgeResponseBody$outboundSchema.parse(updateKnowledgeResponseBody));
}
function updateKnowledgeResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateKnowledgeResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateKnowledgeResponseBody' from JSON`);
}
//# sourceMappingURL=updateknowledge.js.map