"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.AgenticRagConfig$outboundSchema = exports.RerankConfig$outboundSchema = exports.SearchOptions$outboundSchema = exports.FilterBy$outboundSchema = exports.FilterBy1$outboundSchema = exports.SearchKnowledge1Eq$outboundSchema = exports.SearchKnowledge1KnowledgeEq$outboundSchema = exports.SearchKnowledge1Ne$outboundSchema = exports.SearchKnowledge1KnowledgeNe$outboundSchema = exports.SearchKnowledge1Gt$outboundSchema = exports.SearchKnowledge1Gte$outboundSchema = exports.SearchKnowledge1Lt$outboundSchema = exports.SearchKnowledge1Lte$outboundSchema = exports.SearchKnowledge1In$outboundSchema = exports.SearchKnowledge1KnowledgeIn$outboundSchema = exports.SearchKnowledge1Nin$outboundSchema = exports.SearchKnowledge1KnowledgeNin$outboundSchema = exports.SearchKnowledge1Exists$outboundSchema = exports.FilterByAnd$outboundSchema = exports.SearchKnowledgeFilterByAnd$outboundSchema = exports.SearchKnowledgeAndEq$outboundSchema = exports.SearchKnowledgeAndKnowledgeEq$outboundSchema = exports.SearchKnowledgeAndNe$outboundSchema = exports.SearchKnowledgeAndKnowledgeNe$outboundSchema = exports.SearchKnowledgeAndGt$outboundSchema = exports.SearchKnowledgeAndGte$outboundSchema = exports.SearchKnowledgeAndLt$outboundSchema = exports.SearchKnowledgeAndLte$outboundSchema = exports.SearchKnowledgeAndIn$outboundSchema = exports.SearchKnowledgeAndKnowledgeIn$outboundSchema = exports.SearchKnowledgeAndNin$outboundSchema = exports.SearchKnowledgeAndKnowledgeNin$outboundSchema = exports.SearchKnowledgeAndExists$outboundSchema = exports.FilterByOr$outboundSchema = exports.SearchKnowledgeFilterByOr$outboundSchema = exports.SearchKnowledgeOrEq$outboundSchema = exports.SearchKnowledgeOrKnowledgeEq$outboundSchema = exports.SearchKnowledgeOrNe$outboundSchema = exports.SearchKnowledgeOrKnowledgeNe$outboundSchema = exports.SearchKnowledgeOrGt$outboundSchema = exports.SearchKnowledgeOrGte$outboundSchema = exports.SearchKnowledgeOrLt$outboundSchema = exports.SearchKnowledgeOrLte$outboundSchema = exports.SearchKnowledgeOrIn$outboundSchema = exports.SearchKnowledgeOrKnowledgeIn$outboundSchema = exports.SearchKnowledgeOrNin$outboundSchema = exports.SearchKnowledgeOrKnowledgeNin$outboundSchema = exports.SearchKnowledgeOrExists$outboundSchema = exports.SearchType$outboundSchema = exports.SearchType = void 0;
exports.SearchKnowledgeResponseBody$inboundSchema = exports.Matches$inboundSchema = exports.Scores$inboundSchema = exports.SearchKnowledgeRequest$outboundSchema = exports.SearchKnowledgeRequestBody$outboundSchema = void 0;
exports.searchKnowledgeOrExistsToJSON = searchKnowledgeOrExistsToJSON;
exports.searchKnowledgeOrKnowledgeNinToJSON = searchKnowledgeOrKnowledgeNinToJSON;
exports.searchKnowledgeOrNinToJSON = searchKnowledgeOrNinToJSON;
exports.searchKnowledgeOrKnowledgeInToJSON = searchKnowledgeOrKnowledgeInToJSON;
exports.searchKnowledgeOrInToJSON = searchKnowledgeOrInToJSON;
exports.searchKnowledgeOrLteToJSON = searchKnowledgeOrLteToJSON;
exports.searchKnowledgeOrLtToJSON = searchKnowledgeOrLtToJSON;
exports.searchKnowledgeOrGteToJSON = searchKnowledgeOrGteToJSON;
exports.searchKnowledgeOrGtToJSON = searchKnowledgeOrGtToJSON;
exports.searchKnowledgeOrKnowledgeNeToJSON = searchKnowledgeOrKnowledgeNeToJSON;
exports.searchKnowledgeOrNeToJSON = searchKnowledgeOrNeToJSON;
exports.searchKnowledgeOrKnowledgeEqToJSON = searchKnowledgeOrKnowledgeEqToJSON;
exports.searchKnowledgeOrEqToJSON = searchKnowledgeOrEqToJSON;
exports.searchKnowledgeFilterByOrToJSON = searchKnowledgeFilterByOrToJSON;
exports.filterByOrToJSON = filterByOrToJSON;
exports.searchKnowledgeAndExistsToJSON = searchKnowledgeAndExistsToJSON;
exports.searchKnowledgeAndKnowledgeNinToJSON = searchKnowledgeAndKnowledgeNinToJSON;
exports.searchKnowledgeAndNinToJSON = searchKnowledgeAndNinToJSON;
exports.searchKnowledgeAndKnowledgeInToJSON = searchKnowledgeAndKnowledgeInToJSON;
exports.searchKnowledgeAndInToJSON = searchKnowledgeAndInToJSON;
exports.searchKnowledgeAndLteToJSON = searchKnowledgeAndLteToJSON;
exports.searchKnowledgeAndLtToJSON = searchKnowledgeAndLtToJSON;
exports.searchKnowledgeAndGteToJSON = searchKnowledgeAndGteToJSON;
exports.searchKnowledgeAndGtToJSON = searchKnowledgeAndGtToJSON;
exports.searchKnowledgeAndKnowledgeNeToJSON = searchKnowledgeAndKnowledgeNeToJSON;
exports.searchKnowledgeAndNeToJSON = searchKnowledgeAndNeToJSON;
exports.searchKnowledgeAndKnowledgeEqToJSON = searchKnowledgeAndKnowledgeEqToJSON;
exports.searchKnowledgeAndEqToJSON = searchKnowledgeAndEqToJSON;
exports.searchKnowledgeFilterByAndToJSON = searchKnowledgeFilterByAndToJSON;
exports.filterByAndToJSON = filterByAndToJSON;
exports.searchKnowledge1ExistsToJSON = searchKnowledge1ExistsToJSON;
exports.searchKnowledge1KnowledgeNinToJSON = searchKnowledge1KnowledgeNinToJSON;
exports.searchKnowledge1NinToJSON = searchKnowledge1NinToJSON;
exports.searchKnowledge1KnowledgeInToJSON = searchKnowledge1KnowledgeInToJSON;
exports.searchKnowledge1InToJSON = searchKnowledge1InToJSON;
exports.searchKnowledge1LteToJSON = searchKnowledge1LteToJSON;
exports.searchKnowledge1LtToJSON = searchKnowledge1LtToJSON;
exports.searchKnowledge1GteToJSON = searchKnowledge1GteToJSON;
exports.searchKnowledge1GtToJSON = searchKnowledge1GtToJSON;
exports.searchKnowledge1KnowledgeNeToJSON = searchKnowledge1KnowledgeNeToJSON;
exports.searchKnowledge1NeToJSON = searchKnowledge1NeToJSON;
exports.searchKnowledge1KnowledgeEqToJSON = searchKnowledge1KnowledgeEqToJSON;
exports.searchKnowledge1EqToJSON = searchKnowledge1EqToJSON;
exports.filterBy1ToJSON = filterBy1ToJSON;
exports.filterByToJSON = filterByToJSON;
exports.searchOptionsToJSON = searchOptionsToJSON;
exports.rerankConfigToJSON = rerankConfigToJSON;
exports.agenticRagConfigToJSON = agenticRagConfigToJSON;
exports.searchKnowledgeRequestBodyToJSON = searchKnowledgeRequestBodyToJSON;
exports.searchKnowledgeRequestToJSON = searchKnowledgeRequestToJSON;
exports.scoresFromJSON = scoresFromJSON;
exports.matchesFromJSON = matchesFromJSON;
exports.searchKnowledgeResponseBodyFromJSON = searchKnowledgeResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The type of search to perform. If not provided, will default to the knowledge base configured `retrieval_type`
 */
exports.SearchType = {
    VectorSearch: "vector_search",
    KeywordSearch: "keyword_search",
    HybridSearch: "hybrid_search",
};
/** @internal */
exports.SearchType$outboundSchema = z
    .nativeEnum(exports.SearchType);
/** @internal */
exports.SearchKnowledgeOrExists$outboundSchema = z.object({
    exists: z.boolean(),
});
function searchKnowledgeOrExistsToJSON(searchKnowledgeOrExists) {
    return JSON.stringify(exports.SearchKnowledgeOrExists$outboundSchema.parse(searchKnowledgeOrExists));
}
/** @internal */
exports.SearchKnowledgeOrKnowledgeNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeOrKnowledgeNinToJSON(searchKnowledgeOrKnowledgeNin) {
    return JSON.stringify(exports.SearchKnowledgeOrKnowledgeNin$outboundSchema.parse(searchKnowledgeOrKnowledgeNin));
}
/** @internal */
exports.SearchKnowledgeOrNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledgeOrNinToJSON(searchKnowledgeOrNin) {
    return JSON.stringify(exports.SearchKnowledgeOrNin$outboundSchema.parse(searchKnowledgeOrNin));
}
/** @internal */
exports.SearchKnowledgeOrKnowledgeIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeOrKnowledgeInToJSON(searchKnowledgeOrKnowledgeIn) {
    return JSON.stringify(exports.SearchKnowledgeOrKnowledgeIn$outboundSchema.parse(searchKnowledgeOrKnowledgeIn));
}
/** @internal */
exports.SearchKnowledgeOrIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledgeOrInToJSON(searchKnowledgeOrIn) {
    return JSON.stringify(exports.SearchKnowledgeOrIn$outboundSchema.parse(searchKnowledgeOrIn));
}
/** @internal */
exports.SearchKnowledgeOrLte$outboundSchema = z.object({
    lte: z.number(),
});
function searchKnowledgeOrLteToJSON(searchKnowledgeOrLte) {
    return JSON.stringify(exports.SearchKnowledgeOrLte$outboundSchema.parse(searchKnowledgeOrLte));
}
/** @internal */
exports.SearchKnowledgeOrLt$outboundSchema = z.object({
    lt: z.number(),
});
function searchKnowledgeOrLtToJSON(searchKnowledgeOrLt) {
    return JSON.stringify(exports.SearchKnowledgeOrLt$outboundSchema.parse(searchKnowledgeOrLt));
}
/** @internal */
exports.SearchKnowledgeOrGte$outboundSchema = z.object({
    gte: z.number(),
});
function searchKnowledgeOrGteToJSON(searchKnowledgeOrGte) {
    return JSON.stringify(exports.SearchKnowledgeOrGte$outboundSchema.parse(searchKnowledgeOrGte));
}
/** @internal */
exports.SearchKnowledgeOrGt$outboundSchema = z.object({
    gt: z.number(),
});
function searchKnowledgeOrGtToJSON(searchKnowledgeOrGt) {
    return JSON.stringify(exports.SearchKnowledgeOrGt$outboundSchema.parse(searchKnowledgeOrGt));
}
/** @internal */
exports.SearchKnowledgeOrKnowledgeNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeOrKnowledgeNeToJSON(searchKnowledgeOrKnowledgeNe) {
    return JSON.stringify(exports.SearchKnowledgeOrKnowledgeNe$outboundSchema.parse(searchKnowledgeOrKnowledgeNe));
}
/** @internal */
exports.SearchKnowledgeOrNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledgeOrNeToJSON(searchKnowledgeOrNe) {
    return JSON.stringify(exports.SearchKnowledgeOrNe$outboundSchema.parse(searchKnowledgeOrNe));
}
/** @internal */
exports.SearchKnowledgeOrKnowledgeEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeOrKnowledgeEqToJSON(searchKnowledgeOrKnowledgeEq) {
    return JSON.stringify(exports.SearchKnowledgeOrKnowledgeEq$outboundSchema.parse(searchKnowledgeOrKnowledgeEq));
}
/** @internal */
exports.SearchKnowledgeOrEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledgeOrEqToJSON(searchKnowledgeOrEq) {
    return JSON.stringify(exports.SearchKnowledgeOrEq$outboundSchema.parse(searchKnowledgeOrEq));
}
/** @internal */
exports.SearchKnowledgeFilterByOr$outboundSchema = z.union([
    z.lazy(() => exports.SearchKnowledgeOrEq$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrNe$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrGt$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrGte$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrLt$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrLte$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrIn$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrNin$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeOrExists$outboundSchema),
]);
function searchKnowledgeFilterByOrToJSON(searchKnowledgeFilterByOr) {
    return JSON.stringify(exports.SearchKnowledgeFilterByOr$outboundSchema.parse(searchKnowledgeFilterByOr));
}
/** @internal */
exports.FilterByOr$outboundSchema = z.object({
    or: z.array(z.record(z.union([
        z.lazy(() => exports.SearchKnowledgeOrEq$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrNe$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrGt$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrGte$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrLt$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrLte$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrIn$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrNin$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeOrExists$outboundSchema),
    ]))),
});
function filterByOrToJSON(filterByOr) {
    return JSON.stringify(exports.FilterByOr$outboundSchema.parse(filterByOr));
}
/** @internal */
exports.SearchKnowledgeAndExists$outboundSchema = z.object({
    exists: z.boolean(),
});
function searchKnowledgeAndExistsToJSON(searchKnowledgeAndExists) {
    return JSON.stringify(exports.SearchKnowledgeAndExists$outboundSchema.parse(searchKnowledgeAndExists));
}
/** @internal */
exports.SearchKnowledgeAndKnowledgeNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeAndKnowledgeNinToJSON(searchKnowledgeAndKnowledgeNin) {
    return JSON.stringify(exports.SearchKnowledgeAndKnowledgeNin$outboundSchema.parse(searchKnowledgeAndKnowledgeNin));
}
/** @internal */
exports.SearchKnowledgeAndNin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledgeAndNinToJSON(searchKnowledgeAndNin) {
    return JSON.stringify(exports.SearchKnowledgeAndNin$outboundSchema.parse(searchKnowledgeAndNin));
}
/** @internal */
exports.SearchKnowledgeAndKnowledgeIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeAndKnowledgeInToJSON(searchKnowledgeAndKnowledgeIn) {
    return JSON.stringify(exports.SearchKnowledgeAndKnowledgeIn$outboundSchema.parse(searchKnowledgeAndKnowledgeIn));
}
/** @internal */
exports.SearchKnowledgeAndIn$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledgeAndInToJSON(searchKnowledgeAndIn) {
    return JSON.stringify(exports.SearchKnowledgeAndIn$outboundSchema.parse(searchKnowledgeAndIn));
}
/** @internal */
exports.SearchKnowledgeAndLte$outboundSchema = z.object({
    lte: z.number(),
});
function searchKnowledgeAndLteToJSON(searchKnowledgeAndLte) {
    return JSON.stringify(exports.SearchKnowledgeAndLte$outboundSchema.parse(searchKnowledgeAndLte));
}
/** @internal */
exports.SearchKnowledgeAndLt$outboundSchema = z.object({
    lt: z.number(),
});
function searchKnowledgeAndLtToJSON(searchKnowledgeAndLt) {
    return JSON.stringify(exports.SearchKnowledgeAndLt$outboundSchema.parse(searchKnowledgeAndLt));
}
/** @internal */
exports.SearchKnowledgeAndGte$outboundSchema = z.object({
    gte: z.number(),
});
function searchKnowledgeAndGteToJSON(searchKnowledgeAndGte) {
    return JSON.stringify(exports.SearchKnowledgeAndGte$outboundSchema.parse(searchKnowledgeAndGte));
}
/** @internal */
exports.SearchKnowledgeAndGt$outboundSchema = z.object({
    gt: z.number(),
});
function searchKnowledgeAndGtToJSON(searchKnowledgeAndGt) {
    return JSON.stringify(exports.SearchKnowledgeAndGt$outboundSchema.parse(searchKnowledgeAndGt));
}
/** @internal */
exports.SearchKnowledgeAndKnowledgeNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeAndKnowledgeNeToJSON(searchKnowledgeAndKnowledgeNe) {
    return JSON.stringify(exports.SearchKnowledgeAndKnowledgeNe$outboundSchema.parse(searchKnowledgeAndKnowledgeNe));
}
/** @internal */
exports.SearchKnowledgeAndNe$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledgeAndNeToJSON(searchKnowledgeAndNe) {
    return JSON.stringify(exports.SearchKnowledgeAndNe$outboundSchema.parse(searchKnowledgeAndNe));
}
/** @internal */
exports.SearchKnowledgeAndKnowledgeEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledgeAndKnowledgeEqToJSON(searchKnowledgeAndKnowledgeEq) {
    return JSON.stringify(exports.SearchKnowledgeAndKnowledgeEq$outboundSchema.parse(searchKnowledgeAndKnowledgeEq));
}
/** @internal */
exports.SearchKnowledgeAndEq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledgeAndEqToJSON(searchKnowledgeAndEq) {
    return JSON.stringify(exports.SearchKnowledgeAndEq$outboundSchema.parse(searchKnowledgeAndEq));
}
/** @internal */
exports.SearchKnowledgeFilterByAnd$outboundSchema = z.union([
    z.lazy(() => exports.SearchKnowledgeAndEq$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndNe$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndGt$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndGte$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndLt$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndLte$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndIn$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndNin$outboundSchema),
    z.lazy(() => exports.SearchKnowledgeAndExists$outboundSchema),
]);
function searchKnowledgeFilterByAndToJSON(searchKnowledgeFilterByAnd) {
    return JSON.stringify(exports.SearchKnowledgeFilterByAnd$outboundSchema.parse(searchKnowledgeFilterByAnd));
}
/** @internal */
exports.FilterByAnd$outboundSchema = z.object({
    and: z.array(z.record(z.union([
        z.lazy(() => exports.SearchKnowledgeAndEq$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndNe$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndGt$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndGte$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndLt$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndLte$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndIn$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndNin$outboundSchema),
        z.lazy(() => exports.SearchKnowledgeAndExists$outboundSchema),
    ]))),
});
function filterByAndToJSON(filterByAnd) {
    return JSON.stringify(exports.FilterByAnd$outboundSchema.parse(filterByAnd));
}
/** @internal */
exports.SearchKnowledge1Exists$outboundSchema = z.object({
    exists: z.boolean(),
});
function searchKnowledge1ExistsToJSON(searchKnowledge1Exists) {
    return JSON.stringify(exports.SearchKnowledge1Exists$outboundSchema.parse(searchKnowledge1Exists));
}
/** @internal */
exports.SearchKnowledge1KnowledgeNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledge1KnowledgeNinToJSON(searchKnowledge1KnowledgeNin) {
    return JSON.stringify(exports.SearchKnowledge1KnowledgeNin$outboundSchema.parse(searchKnowledge1KnowledgeNin));
}
/** @internal */
exports.SearchKnowledge1Nin$outboundSchema = z.object({
    nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledge1NinToJSON(searchKnowledge1Nin) {
    return JSON.stringify(exports.SearchKnowledge1Nin$outboundSchema.parse(searchKnowledge1Nin));
}
/** @internal */
exports.SearchKnowledge1KnowledgeIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledge1KnowledgeInToJSON(searchKnowledge1KnowledgeIn) {
    return JSON.stringify(exports.SearchKnowledge1KnowledgeIn$outboundSchema.parse(searchKnowledge1KnowledgeIn));
}
/** @internal */
exports.SearchKnowledge1In$outboundSchema = z.object({
    in: z.array(z.union([z.string(), z.number(), z.boolean()])),
});
function searchKnowledge1InToJSON(searchKnowledge1In) {
    return JSON.stringify(exports.SearchKnowledge1In$outboundSchema.parse(searchKnowledge1In));
}
/** @internal */
exports.SearchKnowledge1Lte$outboundSchema = z.object({
    lte: z.number(),
});
function searchKnowledge1LteToJSON(searchKnowledge1Lte) {
    return JSON.stringify(exports.SearchKnowledge1Lte$outboundSchema.parse(searchKnowledge1Lte));
}
/** @internal */
exports.SearchKnowledge1Lt$outboundSchema = z.object({
    lt: z.number(),
});
function searchKnowledge1LtToJSON(searchKnowledge1Lt) {
    return JSON.stringify(exports.SearchKnowledge1Lt$outboundSchema.parse(searchKnowledge1Lt));
}
/** @internal */
exports.SearchKnowledge1Gte$outboundSchema = z.object({
    gte: z.number(),
});
function searchKnowledge1GteToJSON(searchKnowledge1Gte) {
    return JSON.stringify(exports.SearchKnowledge1Gte$outboundSchema.parse(searchKnowledge1Gte));
}
/** @internal */
exports.SearchKnowledge1Gt$outboundSchema = z.object({
    gt: z.number(),
});
function searchKnowledge1GtToJSON(searchKnowledge1Gt) {
    return JSON.stringify(exports.SearchKnowledge1Gt$outboundSchema.parse(searchKnowledge1Gt));
}
/** @internal */
exports.SearchKnowledge1KnowledgeNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledge1KnowledgeNeToJSON(searchKnowledge1KnowledgeNe) {
    return JSON.stringify(exports.SearchKnowledge1KnowledgeNe$outboundSchema.parse(searchKnowledge1KnowledgeNe));
}
/** @internal */
exports.SearchKnowledge1Ne$outboundSchema = z.object({
    ne: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledge1NeToJSON(searchKnowledge1Ne) {
    return JSON.stringify(exports.SearchKnowledge1Ne$outboundSchema.parse(searchKnowledge1Ne));
}
/** @internal */
exports.SearchKnowledge1KnowledgeEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function searchKnowledge1KnowledgeEqToJSON(searchKnowledge1KnowledgeEq) {
    return JSON.stringify(exports.SearchKnowledge1KnowledgeEq$outboundSchema.parse(searchKnowledge1KnowledgeEq));
}
/** @internal */
exports.SearchKnowledge1Eq$outboundSchema = z.object({
    eq: z.union([z.string(), z.number(), z.boolean()]),
});
function searchKnowledge1EqToJSON(searchKnowledge1Eq) {
    return JSON.stringify(exports.SearchKnowledge1Eq$outboundSchema.parse(searchKnowledge1Eq));
}
/** @internal */
exports.FilterBy1$outboundSchema = z.union([
    z.lazy(() => exports.SearchKnowledge1Eq$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Ne$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Gt$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Gte$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Lt$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Lte$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1In$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Nin$outboundSchema),
    z.lazy(() => exports.SearchKnowledge1Exists$outboundSchema),
]);
function filterBy1ToJSON(filterBy1) {
    return JSON.stringify(exports.FilterBy1$outboundSchema.parse(filterBy1));
}
/** @internal */
exports.FilterBy$outboundSchema = z.union([
    z.lazy(() => exports.FilterByAnd$outboundSchema),
    z.lazy(() => exports.FilterByOr$outboundSchema),
    z.record(z.union([
        z.lazy(() => exports.SearchKnowledge1Eq$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Ne$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Gt$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Gte$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Lt$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Lte$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1In$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Nin$outboundSchema),
        z.lazy(() => exports.SearchKnowledge1Exists$outboundSchema),
    ])),
]);
function filterByToJSON(filterBy) {
    return JSON.stringify(exports.FilterBy$outboundSchema.parse(filterBy));
}
/** @internal */
exports.SearchOptions$outboundSchema = z.object({
    includeVectors: z.boolean().optional(),
    includeMetadata: z.boolean().optional(),
    includeScores: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        includeVectors: "include_vectors",
        includeMetadata: "include_metadata",
        includeScores: "include_scores",
    });
});
function searchOptionsToJSON(searchOptions) {
    return JSON.stringify(exports.SearchOptions$outboundSchema.parse(searchOptions));
}
/** @internal */
exports.RerankConfig$outboundSchema = z.object({
    model: z.string(),
    threshold: z.number().default(0),
    topK: z.number().int().default(10),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
    });
});
function rerankConfigToJSON(rerankConfig) {
    return JSON.stringify(exports.RerankConfig$outboundSchema.parse(rerankConfig));
}
/** @internal */
exports.AgenticRagConfig$outboundSchema = z.object({
    model: z.string(),
});
function agenticRagConfigToJSON(agenticRagConfig) {
    return JSON.stringify(exports.AgenticRagConfig$outboundSchema.parse(agenticRagConfig));
}
/** @internal */
exports.SearchKnowledgeRequestBody$outboundSchema = z.object({
    query: z.string(),
    topK: z.number().int().optional(),
    threshold: z.number().optional(),
    searchType: exports.SearchType$outboundSchema.default("hybrid_search"),
    filterBy: z.union([
        z.lazy(() => exports.FilterByAnd$outboundSchema),
        z.lazy(() => exports.FilterByOr$outboundSchema),
        z.record(z.union([
            z.lazy(() => exports.SearchKnowledge1Eq$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Ne$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Gt$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Gte$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Lt$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Lte$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1In$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Nin$outboundSchema),
            z.lazy(() => exports.SearchKnowledge1Exists$outboundSchema),
        ])),
    ]).optional(),
    searchOptions: z.lazy(() => exports.SearchOptions$outboundSchema).optional(),
    rerankConfig: z.lazy(() => exports.RerankConfig$outboundSchema).optional(),
    agenticRagConfig: z.lazy(() => exports.AgenticRagConfig$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        topK: "top_k",
        searchType: "search_type",
        filterBy: "filter_by",
        searchOptions: "search_options",
        rerankConfig: "rerank_config",
        agenticRagConfig: "agentic_rag_config",
    });
});
function searchKnowledgeRequestBodyToJSON(searchKnowledgeRequestBody) {
    return JSON.stringify(exports.SearchKnowledgeRequestBody$outboundSchema.parse(searchKnowledgeRequestBody));
}
/** @internal */
exports.SearchKnowledgeRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
    requestBody: z.lazy(() => exports.SearchKnowledgeRequestBody$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
        requestBody: "RequestBody",
    });
});
function searchKnowledgeRequestToJSON(searchKnowledgeRequest) {
    return JSON.stringify(exports.SearchKnowledgeRequest$outboundSchema.parse(searchKnowledgeRequest));
}
/** @internal */
exports.Scores$inboundSchema = z
    .object({
    rerank_score: z.number().optional(),
    search_score: z.number().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "rerank_score": "rerankScore",
        "search_score": "searchScore",
    });
});
function scoresFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Scores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Scores' from JSON`);
}
/** @internal */
exports.Matches$inboundSchema = z.object({
    id: z.string(),
    text: z.string(),
    vector: z.array(z.number()).optional(),
    metadata: z.record(z.any()).optional(),
    scores: z.lazy(() => exports.Scores$inboundSchema).optional(),
});
function matchesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Matches$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Matches' from JSON`);
}
/** @internal */
exports.SearchKnowledgeResponseBody$inboundSchema = z.object({
    matches: z.array(z.lazy(() => exports.Matches$inboundSchema)),
});
function searchKnowledgeResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SearchKnowledgeResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchKnowledgeResponseBody' from JSON`);
}
//# sourceMappingURL=searchknowledge.js.map