diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 2a1eb0a68..027ac9be5 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -52,15 +52,26 @@ export const completionOptionsSchema = z.object({ }); export type CompletionOptions = z.infer; +export const embeddingTasksSchema = z.union([ + z.literal("chunk"), + z.literal("query") +]); +export type EmbeddingTasks = z.infer; + +export const embeddingPrefixesSchema = z.record(embeddingTasksSchema, z.string()); +export type EmbeddingPrefixes = z.infer; + export const cacheBehaviorSchema = z.object({ cacheSystemMessage: z.boolean().optional(), cacheConversation: z.boolean().optional(), }); export type CacheBehavior = z.infer; + export const embedOptionsSchema = z.object({ maxChunkSize: z.number().optional(), maxBatchSize: z.number().optional(), + embeddingPrefixes: embeddingPrefixesSchema.optional(), }); export type EmbedOptions = z.infer;