Merge pull request #4765 from eliransin/embedding_prefixes_yaml
config-yaml: add embedding prefixes support
This commit is contained in:
commit
7e48feb565
1 changed files with 11 additions and 0 deletions
|
|
@ -52,15 +52,26 @@ export const completionOptionsSchema = z.object({
|
|||
});
|
||||
export type CompletionOptions = z.infer<typeof completionOptionsSchema>;
|
||||
|
||||
export const embeddingTasksSchema = z.union([
|
||||
z.literal("chunk"),
|
||||
z.literal("query")
|
||||
]);
|
||||
export type EmbeddingTasks = z.infer<typeof embeddingTasksSchema>;
|
||||
|
||||
export const embeddingPrefixesSchema = z.record(embeddingTasksSchema, z.string());
|
||||
export type EmbeddingPrefixes = z.infer<typeof embeddingPrefixesSchema>;
|
||||
|
||||
export const cacheBehaviorSchema = z.object({
|
||||
cacheSystemMessage: z.boolean().optional(),
|
||||
cacheConversation: z.boolean().optional(),
|
||||
});
|
||||
export type CacheBehavior = z.infer<typeof cacheBehaviorSchema>;
|
||||
|
||||
|
||||
export const embedOptionsSchema = z.object({
|
||||
maxChunkSize: z.number().optional(),
|
||||
maxBatchSize: z.number().optional(),
|
||||
embeddingPrefixes: embeddingPrefixesSchema.optional(),
|
||||
});
|
||||
export type EmbedOptions = z.infer<typeof embedOptionsSchema>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue