@cognigy/rest-api-client
Version:
Cognigy REST-Client
51 lines • 2.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.knowledgeChunkSchema = exports.knowledgeChunkDataSchema = void 0;
/* Interfaces & Types */
const IEntityMeta_1 = require("../IEntityMeta");
const IGenerativeAIModels_1 = require("../../generativeAI/IGenerativeAIModels");
exports.knowledgeChunkDataSchema = {
title: "knowledgeChunkDataSchema",
type: "object",
additionalProperties: false,
properties: {
order: { type: "number" },
text: {
type: "string",
minLength: 1,
pattern: "\\S",
maxLength: parseInt(process.env.MAX_CHUNK_SIZE, 10) || 2000,
},
embedding: {
type: "object",
additionalProperties: false,
properties: {
vector: {
type: "array"
},
model: {
type: "string",
enum: [...IGenerativeAIModels_1.generativeAIModels]
}
}
},
data: {
type: "object",
additionalProperties: false,
maxProperties: parseInt(process.env.MAX_CHUNK_METADATA_LIMIT, 10) || 20,
patternProperties: {
"^(?=.{1,200}$)[a-zA-Z][0-9a-zA-Z_$]*$": {
type: ["number", "string", "boolean"],
maxLength: parseInt(process.env.METADATA_VALUE_MAX_LENGTH, 10) || 1000
}
},
}
}
};
exports.knowledgeChunkSchema = {
title: "knowledgeChunkSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), exports.knowledgeChunkDataSchema.properties), { disabled: { type: "boolean" }, referenceId: { type: "string", format: "uuid" }, sourceReference: { type: "string", format: "mongo-id" }, storeReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } }),
};
//# sourceMappingURL=IKnowledgeChunk.js.map