From 74485e01181e372c99012eb0758d6b45e62be95c Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 24 Feb 2025 09:51:49 -0800 Subject: [PATCH] yaml env schemas --- packages/config-yaml/src/index.ts | 2 +- packages/config-yaml/src/schemas/models.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/config-yaml/src/index.ts b/packages/config-yaml/src/index.ts index 3d68743db..2e39af496 100644 --- a/packages/config-yaml/src/index.ts +++ b/packages/config-yaml/src/index.ts @@ -9,5 +9,5 @@ export * from "./load/proxySecretResolution.js"; export * from "./load/unroll.js"; export * from "./schemas/data/index.js"; export * from "./schemas/index.js"; -export type { ModelConfig, ModelRole } from "./schemas/models.js"; +export type { EmbedOptions, ModelConfig, ModelRole } from "./schemas/models.js"; export * from "./validation.js"; diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 05df2c1ad..19cf65e51 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -42,6 +42,12 @@ export const completionOptionsSchema = z.object({ }); export type CompletionOptions = z.infer; +export const embedOptionsSchema = z.object({ + maxChunkSize: z.number().optional(), + maxBatchSize: z.number().optional(), +}); +export type EmbedOptions = z.infer; + /** Prompt templates use Handlebars syntax */ const promptTemplatesSchema = z.object({ apply: z.string().optional(), @@ -57,7 +63,9 @@ const baseModelFields = { roles: modelRolesSchema.array().optional(), defaultCompletionOptions: completionOptionsSchema.optional(), requestOptions: requestOptionsSchema.optional(), + embedOptions: embedOptionsSchema.optional(), promptTemplates: promptTemplatesSchema.optional(), + env: z.record(z.string(), z.string()).optional(), }; export const modelSchema = z.union([