"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.ListKnowledgeBasesResponseBody$inboundSchema = exports.ListKnowledgeBasesData$inboundSchema = exports.Data1$inboundSchema = exports.ListKnowledgeBasesDataRetrievalSettings$inboundSchema = exports.ListKnowledgeBasesDataAgenticRagConfig$inboundSchema = exports.ListKnowledgeBasesDataRerankConfig$inboundSchema = exports.DataRetrievalType$inboundSchema = exports.ListKnowledgeBasesDataType$inboundSchema = exports.Data2$inboundSchema = exports.DataExternalConfig$inboundSchema = exports.DataRetrievalSettings$inboundSchema = exports.DataAgenticRagConfig$inboundSchema = exports.DataRerankConfig$inboundSchema = exports.ListKnowledgeBasesDataKnowledgeType$inboundSchema = exports.ListKnowledgeBasesObject$inboundSchema = exports.ListKnowledgeBasesRequest$outboundSchema = exports.DataRetrievalType = exports.ListKnowledgeBasesDataType = exports.ListKnowledgeBasesDataKnowledgeType = exports.ListKnowledgeBasesObject = void 0;
exports.listKnowledgeBasesRequestToJSON = listKnowledgeBasesRequestToJSON;
exports.dataRerankConfigFromJSON = dataRerankConfigFromJSON;
exports.dataAgenticRagConfigFromJSON = dataAgenticRagConfigFromJSON;
exports.dataRetrievalSettingsFromJSON = dataRetrievalSettingsFromJSON;
exports.dataExternalConfigFromJSON = dataExternalConfigFromJSON;
exports.data2FromJSON = data2FromJSON;
exports.listKnowledgeBasesDataRerankConfigFromJSON = listKnowledgeBasesDataRerankConfigFromJSON;
exports.listKnowledgeBasesDataAgenticRagConfigFromJSON = listKnowledgeBasesDataAgenticRagConfigFromJSON;
exports.listKnowledgeBasesDataRetrievalSettingsFromJSON = listKnowledgeBasesDataRetrievalSettingsFromJSON;
exports.data1FromJSON = data1FromJSON;
exports.listKnowledgeBasesDataFromJSON = listKnowledgeBasesDataFromJSON;
exports.listKnowledgeBasesResponseBodyFromJSON = listKnowledgeBasesResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.ListKnowledgeBasesObject = {
    List: "list",
};
exports.ListKnowledgeBasesDataKnowledgeType = {
    External: "external",
};
exports.ListKnowledgeBasesDataType = {
    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.DataRetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
/** @internal */
exports.ListKnowledgeBasesRequest$outboundSchema = z.object({
    startingAfter: z.string().optional(),
    endingBefore: z.string().optional(),
    limit: z.number().int().default(25),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        startingAfter: "starting_after",
        endingBefore: "ending_before",
    });
});
function listKnowledgeBasesRequestToJSON(listKnowledgeBasesRequest) {
    return JSON.stringify(exports.ListKnowledgeBasesRequest$outboundSchema.parse(listKnowledgeBasesRequest));
}
/** @internal */
exports.ListKnowledgeBasesObject$inboundSchema = z.nativeEnum(exports.ListKnowledgeBasesObject);
/** @internal */
exports.ListKnowledgeBasesDataKnowledgeType$inboundSchema = z.nativeEnum(exports.ListKnowledgeBasesDataKnowledgeType);
/** @internal */
exports.DataRerankConfig$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",
    });
});
function dataRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DataRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataRerankConfig' from JSON`);
}
/** @internal */
exports.DataAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
function dataAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DataAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataAgenticRagConfig' from JSON`);
}
/** @internal */
exports.DataRetrievalSettings$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.DataRerankConfig$inboundSchema))
        .optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.DataAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
function dataRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DataRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataRetrievalSettings' from JSON`);
}
/** @internal */
exports.DataExternalConfig$inboundSchema = z.object({
    name: z.string(),
    api_url: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
    });
});
function dataExternalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DataExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataExternalConfig' from JSON`);
}
/** @internal */
exports.Data2$inboundSchema = z
    .object({
    _id: z.string(),
    created: z.string(),
    description: z.nullable(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.ListKnowledgeBasesDataKnowledgeType$inboundSchema.default("external"),
    retrieval_settings: z.lazy(() => exports.DataRetrievalSettings$inboundSchema)
        .optional(),
    external_config: z.lazy(() => exports.DataExternalConfig$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",
    });
});
function data2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data2' from JSON`);
}
/** @internal */
exports.ListKnowledgeBasesDataType$inboundSchema = z.nativeEnum(exports.ListKnowledgeBasesDataType);
/** @internal */
exports.DataRetrievalType$inboundSchema = z.nativeEnum(exports.DataRetrievalType);
/** @internal */
exports.ListKnowledgeBasesDataRerankConfig$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",
    });
});
function listKnowledgeBasesDataRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListKnowledgeBasesDataRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKnowledgeBasesDataRerankConfig' from JSON`);
}
/** @internal */
exports.ListKnowledgeBasesDataAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
function listKnowledgeBasesDataAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListKnowledgeBasesDataAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKnowledgeBasesDataAgenticRagConfig' from JSON`);
}
/** @internal */
exports.ListKnowledgeBasesDataRetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.DataRetrievalType$inboundSchema.default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.ListKnowledgeBasesDataRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.ListKnowledgeBasesDataAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "retrieval_type": "retrievalType",
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
function listKnowledgeBasesDataRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListKnowledgeBasesDataRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKnowledgeBasesDataRetrievalSettings' from JSON`);
}
/** @internal */
exports.Data1$inboundSchema = z
    .object({
    _id: z.string(),
    created: z.string(),
    description: z.nullable(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.ListKnowledgeBasesDataType$inboundSchema.default("internal"),
    retrieval_settings: z.lazy(() => exports.ListKnowledgeBasesDataRetrievalSettings$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",
    });
});
function data1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data1' from JSON`);
}
/** @internal */
exports.ListKnowledgeBasesData$inboundSchema = z.union([
    z.lazy(() => exports.Data1$inboundSchema),
    z.lazy(() => exports.Data2$inboundSchema),
]);
function listKnowledgeBasesDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListKnowledgeBasesData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKnowledgeBasesData' from JSON`);
}
/** @internal */
exports.ListKnowledgeBasesResponseBody$inboundSchema = z.object({
    object: exports.ListKnowledgeBasesObject$inboundSchema,
    data: z.array(z.union([
        z.lazy(() => exports.Data1$inboundSchema),
        z.lazy(() => exports.Data2$inboundSchema),
    ])),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
function listKnowledgeBasesResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListKnowledgeBasesResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListKnowledgeBasesResponseBody' from JSON`);
}
//# sourceMappingURL=listknowledgebases.js.map