@cognigy/rest-api-client
Version:
Cognigy REST-Client
48 lines • 1.96 kB
JavaScript
/* Interfaces & Types */
import { entityMetaSchema } from "../IEntityMeta";
import { generativeAIModels } from "../../generativeAI/IGenerativeAIModels";
export const 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: [...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
}
},
}
}
};
export const knowledgeChunkSchema = {
title: "knowledgeChunkSchema",
type: "object",
additionalProperties: false,
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), 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