"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.GetOneKnowledgeResponseBody$inboundSchema = exports.GetOneKnowledgeResponseBody1$inboundSchema = exports.GetOneKnowledgeResponseBodyRetrievalSettings$inboundSchema = exports.GetOneKnowledgeResponseBodyAgenticRagConfig$inboundSchema = exports.GetOneKnowledgeResponseBodyRerankConfig$inboundSchema = exports.GetOneKnowledgeResponseBodyRetrievalType$inboundSchema = exports.GetOneKnowledgeResponseBodyType$inboundSchema = exports.GetOneKnowledgeResponseBody2$inboundSchema = exports.GetOneKnowledgeResponseBodyExternalConfig$inboundSchema = exports.GetOneKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema = exports.GetOneKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema = exports.GetOneKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema = exports.GetOneKnowledgeResponseBodyKnowledgeType$inboundSchema = exports.GetOneKnowledgeRequest$outboundSchema = exports.GetOneKnowledgeResponseBodyRetrievalType = exports.GetOneKnowledgeResponseBodyType = exports.GetOneKnowledgeResponseBodyKnowledgeType = void 0;
exports.getOneKnowledgeRequestToJSON = getOneKnowledgeRequestToJSON;
exports.getOneKnowledgeResponseBodyKnowledgeRerankConfigFromJSON = getOneKnowledgeResponseBodyKnowledgeRerankConfigFromJSON;
exports.getOneKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON = getOneKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON;
exports.getOneKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON = getOneKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON;
exports.getOneKnowledgeResponseBodyExternalConfigFromJSON = getOneKnowledgeResponseBodyExternalConfigFromJSON;
exports.getOneKnowledgeResponseBody2FromJSON = getOneKnowledgeResponseBody2FromJSON;
exports.getOneKnowledgeResponseBodyRerankConfigFromJSON = getOneKnowledgeResponseBodyRerankConfigFromJSON;
exports.getOneKnowledgeResponseBodyAgenticRagConfigFromJSON = getOneKnowledgeResponseBodyAgenticRagConfigFromJSON;
exports.getOneKnowledgeResponseBodyRetrievalSettingsFromJSON = getOneKnowledgeResponseBodyRetrievalSettingsFromJSON;
exports.getOneKnowledgeResponseBody1FromJSON = getOneKnowledgeResponseBody1FromJSON;
exports.getOneKnowledgeResponseBodyFromJSON = getOneKnowledgeResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.GetOneKnowledgeResponseBodyKnowledgeType = {
    External: "external",
};
exports.GetOneKnowledgeResponseBodyType = {
    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.GetOneKnowledgeResponseBodyRetrievalType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
/** @internal */
exports.GetOneKnowledgeRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
    });
});
function getOneKnowledgeRequestToJSON(getOneKnowledgeRequest) {
    return JSON.stringify(exports.GetOneKnowledgeRequest$outboundSchema.parse(getOneKnowledgeRequest));
}
/** @internal */
exports.GetOneKnowledgeResponseBodyKnowledgeType$inboundSchema = z
    .nativeEnum(exports.GetOneKnowledgeResponseBodyKnowledgeType);
/** @internal */
exports.GetOneKnowledgeResponseBodyKnowledgeRerankConfig$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 getOneKnowledgeResponseBodyKnowledgeRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyKnowledgeRerankConfig' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
function getOneKnowledgeResponseBodyKnowledgeAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyKnowledgeAgenticRagConfig' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema = z.object({
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.GetOneKnowledgeResponseBodyKnowledgeRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.GetOneKnowledgeResponseBodyKnowledgeAgenticRagConfig$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "top_k": "topK",
        "rerank_config": "rerankConfig",
        "agentic_rag_config": "agenticRagConfig",
    });
});
function getOneKnowledgeResponseBodyKnowledgeRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyKnowledgeRetrievalSettings' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyExternalConfig$inboundSchema = z.object({
    name: z.string(),
    api_url: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_url": "apiUrl",
    });
});
function getOneKnowledgeResponseBodyExternalConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyExternalConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyExternalConfig' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBody2$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.GetOneKnowledgeResponseBodyKnowledgeType$inboundSchema.default("external"),
    retrieval_settings: z.lazy(() => exports.GetOneKnowledgeResponseBodyKnowledgeRetrievalSettings$inboundSchema).optional(),
    external_config: z.lazy(() => exports.GetOneKnowledgeResponseBodyExternalConfig$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 getOneKnowledgeResponseBody2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBody2' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyType$inboundSchema = z.nativeEnum(exports.GetOneKnowledgeResponseBodyType);
/** @internal */
exports.GetOneKnowledgeResponseBodyRetrievalType$inboundSchema = z
    .nativeEnum(exports.GetOneKnowledgeResponseBodyRetrievalType);
/** @internal */
exports.GetOneKnowledgeResponseBodyRerankConfig$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 getOneKnowledgeResponseBodyRerankConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyRerankConfig' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyAgenticRagConfig$inboundSchema = z.object({
    model: z.string(),
});
function getOneKnowledgeResponseBodyAgenticRagConfigFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyAgenticRagConfig' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBodyRetrievalSettings$inboundSchema = z.object({
    retrieval_type: exports.GetOneKnowledgeResponseBodyRetrievalType$inboundSchema
        .default("hybrid_search"),
    top_k: z.number().int().default(5),
    threshold: z.number().default(0),
    rerank_config: z.nullable(z.lazy(() => exports.GetOneKnowledgeResponseBodyRerankConfig$inboundSchema)).optional(),
    agentic_rag_config: z.nullable(z.lazy(() => exports.GetOneKnowledgeResponseBodyAgenticRagConfig$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 getOneKnowledgeResponseBodyRetrievalSettingsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBodyRetrievalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBodyRetrievalSettings' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBody1$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.GetOneKnowledgeResponseBodyType$inboundSchema.default("internal"),
    retrieval_settings: z.lazy(() => exports.GetOneKnowledgeResponseBodyRetrievalSettings$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 getOneKnowledgeResponseBody1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBody1' from JSON`);
}
/** @internal */
exports.GetOneKnowledgeResponseBody$inboundSchema = z.union([
    z.lazy(() => exports.GetOneKnowledgeResponseBody1$inboundSchema),
    z.lazy(() => exports.GetOneKnowledgeResponseBody2$inboundSchema),
]);
function getOneKnowledgeResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetOneKnowledgeResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetOneKnowledgeResponseBody' from JSON`);
}
//# sourceMappingURL=getoneknowledge.js.map