"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.ResponseBody1$outboundSchema = exports.ResponseBody1$inboundSchema = exports.ResponseBodyRetrievalSettings$outboundSchema = exports.ResponseBodyRetrievalSettings$inboundSchema = exports.ResponseBodyAgenticRagConfig$outboundSchema = exports.ResponseBodyAgenticRagConfig$inboundSchema = exports.ResponseBodyRerankConfig$outboundSchema = exports.ResponseBodyRerankConfig$inboundSchema = exports.ResponseBodyRetrievalType$outboundSchema = exports.ResponseBodyRetrievalType$inboundSchema = exports.CreateKnowledgeResponseBodyType$outboundSchema = exports.CreateKnowledgeResponseBodyType$inboundSchema = exports.ResponseBody2$outboundSchema = exports.ResponseBody2$inboundSchema = exports.ResponseBodyExternalConfig$outboundSchema = exports.ResponseBodyExternalConfig$inboundSchema = exports.CreateKnowledgeResponseBodyRetrievalSettings$outboundSchema = exports.CreateKnowledgeResponseBodyRetrievalSettings$inboundSchema = exports.CreateKnowledgeResponseBodyAgenticRagConfig$outboundSchema = exports.CreateKnowledgeResponseBodyAgenticRagConfig$inboundSchema = exports.CreateKnowledgeResponseBodyRerankConfig$outboundSchema = exports.CreateKnowledgeResponseBodyRerankConfig$inboundSchema = exports.CreateKnowledgeResponseBodyKnowledgeType$outboundSchema = exports.CreateKnowledgeResponseBodyKnowledgeType$inboundSchema = exports.CreateKnowledgeRequestBody$outboundSchema = exports.CreateKnowledgeRequestBody$inboundSchema = exports.RequestBody1$outboundSchema = exports.RequestBody1$inboundSchema = exports.RetrievalSettings$outboundSchema = exports.RetrievalSettings$inboundSchema = exports.CreateKnowledgeRequestBodyAgenticRagConfig$outboundSchema = exports.CreateKnowledgeRequestBodyAgenticRagConfig$inboundSchema = exports.CreateKnowledgeRequestBodyRerankConfig$outboundSchema = exports.CreateKnowledgeRequestBodyRerankConfig$inboundSchema = exports.RetrievalType$outboundSchema = exports.RetrievalType$inboundSchema = exports.CreateKnowledgeRequestBodyType$outboundSchema = exports.CreateKnowledgeRequestBodyType$inboundSchema = exports.RequestBody2$outboundSchema = exports.RequestBody2$inboundSchema = exports.ExternalConfig$outboundSchema = exports.ExternalConfig$inboundSchema = exports.CreateKnowledgeRequestBodyKnowledgeType$outboundSchema = exports.CreateKnowledgeRequestBodyKnowledgeType$inboundSchema = exports.ResponseBodyRetrievalType = exports.CreateKnowledgeResponseBodyType = exports.CreateKnowledgeResponseBodyKnowledgeType = exports.RetrievalType = exports.CreateKnowledgeRequestBodyType = exports.CreateKnowledgeRequestBodyKnowledgeType = void 0;
exports.CreateKnowledgeResponseBody$outboundSchema = exports.CreateKnowledgeResponseBody$inboundSchema = void 0;
exports.externalConfigToJSON = externalConfigToJSON;
exports.externalConfigFromJSON = externalConfigFromJSON;
exports.requestBody2ToJSON = requestBody2ToJSON;
exports.requestBody2FromJSON = requestBody2FromJSON;
exports.createKnowledgeRequestBodyRerankConfigToJSON = createKnowledgeRequestBodyRerankConfigToJSON;
exports.createKnowledgeRequestBodyRerankConfigFromJSON = createKnowledgeRequestBodyRerankConfigFromJSON;
exports.createKnowledgeRequestBodyAgenticRagConfigToJSON = createKnowledgeRequestBodyAgenticRagConfigToJSON;
exports.createKnowledgeRequestBodyAgenticRagConfigFromJSON = createKnowledgeRequestBodyAgenticRagConfigFromJSON;
exports.retrievalSettingsToJSON = retrievalSettingsToJSON;
exports.retrievalSettingsFromJSON = retrievalSettingsFromJSON;
exports.requestBody1ToJSON = requestBody1ToJSON;
exports.requestBody1FromJSON = requestBody1FromJSON;
exports.createKnowledgeRequestBodyToJSON = createKnowledgeRequestBodyToJSON;
exports.createKnowledgeRequestBodyFromJSON = createKnowledgeRequestBodyFromJSON;
exports.createKnowledgeResponseBodyRerankConfigToJSON = createKnowledgeResponseBodyRerankConfigToJSON;
exports.createKnowledgeResponseBodyRerankConfigFromJSON = createKnowledgeResponseBodyRerankConfigFromJSON;
exports.createKnowledgeResponseBodyAgenticRagConfigToJSON = createKnowledgeResponseBodyAgenticRagConfigToJSON;
exports.createKnowledgeResponseBodyAgenticRagConfigFromJSON = createKnowledgeResponseBodyAgenticRagConfigFromJSON;
exports.createKnowledgeResponseBodyRetrievalSettingsToJSON = createKnowledgeResponseBodyRetrievalSettingsToJSON;
exports.createKnowledgeResponseBodyRetrievalSettingsFromJSON = createKnowledgeResponseBodyRetrievalSettingsFromJSON;
exports.responseBodyExternalConfigToJSON = responseBodyExternalConfigToJSON;
exports.responseBodyExternalConfigFromJSON = responseBodyExternalConfigFromJSON;
exports.responseBody2ToJSON = responseBody2ToJSON;
exports.responseBody2FromJSON = responseBody2FromJSON;
exports.responseBodyRerankConfigToJSON = responseBodyRerankConfigToJSON;
exports.responseBodyRerankConfigFromJSON = responseBodyRerankConfigFromJSON;
exports.responseBodyAgenticRagConfigToJSON = responseBodyAgenticRagConfigToJSON;
exports.responseBodyAgenticRagConfigFromJSON = responseBodyAgenticRagConfigFromJSON;
exports.responseBodyRetrievalSettingsToJSON = responseBodyRetrievalSettingsToJSON;
exports.responseBodyRetrievalSettingsFromJSON = responseBodyRetrievalSettingsFromJSON;
exports.responseBody1ToJSON = responseBody1ToJSON;
exports.responseBody1FromJSON = responseBody1FromJSON;
exports.createKnowledgeResponseBodyToJSON = createKnowledgeResponseBodyToJSON;
exports.createKnowledgeResponseBodyFromJSON = createKnowledgeResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.CreateKnowledgeRequestBodyKnowledgeType = {
    External: "external",
};
exports.CreateKnowledgeRequestBodyType = {
    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.RetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
exports.CreateKnowledgeResponseBodyKnowledgeType = {
    External: "external",
};
exports.CreateKnowledgeResponseBodyType = {
    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.ResponseBodyRetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
/** @internal */
exports.CreateKnowledgeRequestBodyKnowledgeType$inboundSchema = z
    .nativeEnum(exports.CreateKnowledgeRequestBodyKnowledgeType);
/** @internal */
exports.CreateKnowledgeRequestBodyKnowledgeType$outboundSchema = exports.CreateKnowledgeRequestBodyKnowledgeType$inboundSchema;
/** @internal */
exports.ExternalConfig$inboundSchema = z.object({
    name: z.string(),
    api_url: z.string(),
    api_key: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
        "api_key": "apiKey",
    });
});
/** @internal */
exports.ExternalConfig$outboundSchema = z.object({
    name: z.string(),
    apiUrl: z.string(),
    apiKey: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        apiUrl: "api_url",
        apiKey: "api_key",
    });
});
function externalConfigToJSON(externalConfig) {
    return JSON.stringify(exports.ExternalConfig$outboundSchema.parse(externalConfig));
}
function externalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExternalConfig' from JSON`);
}
/** @internal */
exports.RequestBody2$inboundSchema = z.object({
    type: exports.CreateKnowledgeRequestBodyKnowledgeType$inboundSchema.default("external"),
    key: z.string(),
    description: z.string().optional(),
    external_config: z.lazy(() => exports.ExternalConfig$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "external_config": "externalConfig",
    });
});
/** @internal */
exports.RequestBody2$outboundSchema = z.object({
    type: exports.CreateKnowledgeRequestBodyKnowledgeType$outboundSchema.default("external"),
    key: z.string(),
    description: z.string().optional(),
    externalConfig: z.lazy(() => exports.ExternalConfig$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        externalConfig: "external_config",
    });
});
function requestBody2ToJSON(requestBody2) {
    return JSON.stringify(exports.RequestBody2$outboundSchema.parse(requestBody2));
}
function requestBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBody2' from JSON`);
}
/** @internal */
exports.CreateKnowledgeRequestBodyType$inboundSchema = z.nativeEnum(exports.CreateKnowledgeRequestBodyType);
/** @internal */
exports.CreateKnowledgeRequestBodyType$outboundSchema = exports.CreateKnowledgeRequestBodyType$inboundSchema;
/** @internal */
exports.RetrievalType$inboundSchema = z.nativeEnum(exports.RetrievalType);
/** @internal */
exports.RetrievalType$outboundSchema = exports.RetrievalType$inboundSchema;
/** @internal */
exports.CreateKnowledgeRequestBodyRerankConfig$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.CreateKnowledgeRequestBodyRerankConfig$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 createKnowledgeRequestBodyRerankConfigToJSON(createKnowledgeRequestBodyRerankConfig) {
    return JSON.stringify(exports.CreateKnowledgeRequestBodyRerankConfig$outboundSchema.parse(createKnowledgeRequestBodyRerankConfig));
}
function createKnowledgeRequestBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeRequestBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeRequestBodyRerankConfig' from JSON`);
}
/** @internal */
exports.CreateKnowledgeRequestBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.CreateKnowledgeRequestBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function createKnowledgeRequestBodyAgenticRagConfigToJSON(createKnowledgeRequestBodyAgenticRagConfig) {
    return JSON.stringify(exports.CreateKnowledgeRequestBodyAgenticRagConfig$outboundSchema.parse(createKnowledgeRequestBodyAgenticRagConfig));
}
function createKnowledgeRequestBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeRequestBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeRequestBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.RetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.RetrievalType$inboundSchema.default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.CreateKnowledgeRequestBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.CreateKnowledgeRequestBodyAgenticRagConfig$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.RetrievalSettings$outboundSchema = z.object({
    retrievalType: exports.RetrievalType$outboundSchema.default("hybrid_search"),
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.CreateKnowledgeRequestBodyRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.CreateKnowledgeRequestBodyAgenticRagConfig$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 retrievalSettingsToJSON(retrievalSettings) {
    return JSON.stringify(exports.RetrievalSettings$outboundSchema.parse(retrievalSettings));
}
function retrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RetrievalSettings' from JSON`);
}
/** @internal */
exports.RequestBody1$inboundSchema = z.object({
    type: exports.CreateKnowledgeRequestBodyType$inboundSchema.default("internal"),
    key: z.string(),
    description: z.string().optional(),
    embedding_model: z.string(),
    retrieval_settings: z.lazy(() => exports.RetrievalSettings$inboundSchema).optional(),
    path: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "embedding_model": "embeddingModel",
        "retrieval_settings": "retrievalSettings",
    });
});
/** @internal */
exports.RequestBody1$outboundSchema = z.object({
    type: exports.CreateKnowledgeRequestBodyType$outboundSchema.default("internal"),
    key: z.string(),
    description: z.string().optional(),
    embeddingModel: z.string(),
    retrievalSettings: z.lazy(() => exports.RetrievalSettings$outboundSchema).optional(),
    path: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        embeddingModel: "embedding_model",
        retrievalSettings: "retrieval_settings",
    });
});
function requestBody1ToJSON(requestBody1) {
    return JSON.stringify(exports.RequestBody1$outboundSchema.parse(requestBody1));
}
function requestBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RequestBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBody1' from JSON`);
}
/** @internal */
exports.CreateKnowledgeRequestBody$inboundSchema = z.union([
    z.lazy(() => exports.RequestBody1$inboundSchema),
    z.lazy(() => exports.RequestBody2$inboundSchema),
]);
/** @internal */
exports.CreateKnowledgeRequestBody$outboundSchema = z.union([
    z.lazy(() => exports.RequestBody1$outboundSchema),
    z.lazy(() => exports.RequestBody2$outboundSchema),
]);
function createKnowledgeRequestBodyToJSON(createKnowledgeRequestBody) {
    return JSON.stringify(exports.CreateKnowledgeRequestBody$outboundSchema.parse(createKnowledgeRequestBody));
}
function createKnowledgeRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeRequestBody' from JSON`);
}
/** @internal */
exports.CreateKnowledgeResponseBodyKnowledgeType$inboundSchema = z
    .nativeEnum(exports.CreateKnowledgeResponseBodyKnowledgeType);
/** @internal */
exports.CreateKnowledgeResponseBodyKnowledgeType$outboundSchema = exports.CreateKnowledgeResponseBodyKnowledgeType$inboundSchema;
/** @internal */
exports.CreateKnowledgeResponseBodyRerankConfig$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.CreateKnowledgeResponseBodyRerankConfig$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 createKnowledgeResponseBodyRerankConfigToJSON(createKnowledgeResponseBodyRerankConfig) {
    return JSON.stringify(exports.CreateKnowledgeResponseBodyRerankConfig$outboundSchema.parse(createKnowledgeResponseBodyRerankConfig));
}
function createKnowledgeResponseBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeResponseBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeResponseBodyRerankConfig' from JSON`);
}
/** @internal */
exports.CreateKnowledgeResponseBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.CreateKnowledgeResponseBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function createKnowledgeResponseBodyAgenticRagConfigToJSON(createKnowledgeResponseBodyAgenticRagConfig) {
    return JSON.stringify(exports.CreateKnowledgeResponseBodyAgenticRagConfig$outboundSchema.parse(createKnowledgeResponseBodyAgenticRagConfig));
}
function createKnowledgeResponseBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeResponseBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeResponseBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.CreateKnowledgeResponseBodyRetrievalSettings$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.CreateKnowledgeResponseBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.CreateKnowledgeResponseBodyAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
/** @internal */
exports.CreateKnowledgeResponseBodyRetrievalSettings$outboundSchema = z.object({
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.CreateKnowledgeResponseBodyRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.CreateKnowledgeResponseBodyAgenticRagConfig$outboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function createKnowledgeResponseBodyRetrievalSettingsToJSON(createKnowledgeResponseBodyRetrievalSettings) {
    return JSON.stringify(exports.CreateKnowledgeResponseBodyRetrievalSettings$outboundSchema.parse(createKnowledgeResponseBodyRetrievalSettings));
}
function createKnowledgeResponseBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeResponseBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeResponseBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.ResponseBodyExternalConfig$inboundSchema = z.object({
    name: z.string(),
    api_url: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
    });
});
/** @internal */
exports.ResponseBodyExternalConfig$outboundSchema = z.object({
    name: z.string(),
    apiUrl: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        apiUrl: "api_url",
    });
});
function responseBodyExternalConfigToJSON(responseBodyExternalConfig) {
    return JSON.stringify(exports.ResponseBodyExternalConfig$outboundSchema.parse(responseBodyExternalConfig));
}
function responseBodyExternalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodyExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyExternalConfig' from JSON`);
}
/** @internal */
exports.ResponseBody2$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.CreateKnowledgeResponseBodyKnowledgeType$inboundSchema.default("external"),
    retrieval_settings: z.lazy(() => exports.CreateKnowledgeResponseBodyRetrievalSettings$inboundSchema).optional(),
    external_config: z.lazy(() => exports.ResponseBodyExternalConfig$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.ResponseBody2$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.CreateKnowledgeResponseBodyKnowledgeType$outboundSchema.default("external"),
    retrievalSettings: z.lazy(() => exports.CreateKnowledgeResponseBodyRetrievalSettings$outboundSchema).optional(),
    externalConfig: z.lazy(() => exports.ResponseBodyExternalConfig$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 responseBody2ToJSON(responseBody2) {
    return JSON.stringify(exports.ResponseBody2$outboundSchema.parse(responseBody2));
}
function responseBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBody2' from JSON`);
}
/** @internal */
exports.CreateKnowledgeResponseBodyType$inboundSchema = z.nativeEnum(exports.CreateKnowledgeResponseBodyType);
/** @internal */
exports.CreateKnowledgeResponseBodyType$outboundSchema = exports.CreateKnowledgeResponseBodyType$inboundSchema;
/** @internal */
exports.ResponseBodyRetrievalType$inboundSchema = z.nativeEnum(exports.ResponseBodyRetrievalType);
/** @internal */
exports.ResponseBodyRetrievalType$outboundSchema = exports.ResponseBodyRetrievalType$inboundSchema;
/** @internal */
exports.ResponseBodyRerankConfig$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.ResponseBodyRerankConfig$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 responseBodyRerankConfigToJSON(responseBodyRerankConfig) {
    return JSON.stringify(exports.ResponseBodyRerankConfig$outboundSchema.parse(responseBodyRerankConfig));
}
function responseBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyRerankConfig' from JSON`);
}
/** @internal */
exports.ResponseBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
/** @internal */
exports.ResponseBodyAgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function responseBodyAgenticRagConfigToJSON(responseBodyAgenticRagConfig) {
    return JSON.stringify(exports.ResponseBodyAgenticRagConfig$outboundSchema.parse(responseBodyAgenticRagConfig));
}
function responseBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.ResponseBodyRetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.ResponseBodyRetrievalType$inboundSchema.default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.ResponseBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.ResponseBodyAgenticRagConfig$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.ResponseBodyRetrievalSettings$outboundSchema = z.object({
    retrievalType: exports.ResponseBodyRetrievalType$outboundSchema.default("hybrid_search"),
    topK: z.number().int().default(5),
    threshold: z.number().default(0),
    rerankConfig: z.nullable(z.lazy(() => exports.ResponseBodyRerankConfig$outboundSchema)).optional(),
    agenticRagConfig: z.nullable(z.lazy(() => exports.ResponseBodyAgenticRagConfig$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 responseBodyRetrievalSettingsToJSON(responseBodyRetrievalSettings) {
    return JSON.stringify(exports.ResponseBodyRetrievalSettings$outboundSchema.parse(responseBodyRetrievalSettings));
}
function responseBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.ResponseBody1$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.CreateKnowledgeResponseBodyType$inboundSchema.default("internal"),
    retrieval_settings: z.lazy(() => exports.ResponseBodyRetrievalSettings$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.ResponseBody1$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.CreateKnowledgeResponseBodyType$outboundSchema.default("internal"),
    retrievalSettings: z.lazy(() => exports.ResponseBodyRetrievalSettings$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 responseBody1ToJSON(responseBody1) {
    return JSON.stringify(exports.ResponseBody1$outboundSchema.parse(responseBody1));
}
function responseBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseBody1' from JSON`);
}
/** @internal */
exports.CreateKnowledgeResponseBody$inboundSchema = z.union([
    z.lazy(() => exports.ResponseBody1$inboundSchema),
    z.lazy(() => exports.ResponseBody2$inboundSchema),
]);
/** @internal */
exports.CreateKnowledgeResponseBody$outboundSchema = z.union([
    z.lazy(() => exports.ResponseBody1$outboundSchema),
    z.lazy(() => exports.ResponseBody2$outboundSchema),
]);
function createKnowledgeResponseBodyToJSON(createKnowledgeResponseBody) {
    return JSON.stringify(exports.CreateKnowledgeResponseBody$outboundSchema.parse(createKnowledgeResponseBody));
}
function createKnowledgeResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateKnowledgeResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateKnowledgeResponseBody' from JSON`);
}
//# sourceMappingURL=createknowledge.js.map