From af522091c1cb7ebb5aa0ecc9bbc01eab58e46459 Mon Sep 17 00:00:00 2001 From: Sayo Date: Wed, 12 Feb 2025 22:19:05 +0530 Subject: [PATCH] just minor biome pref --- packages/plugin-anthropic/src/index.ts | 8 +++++--- packages/plugin-openai/src/index.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/plugin-anthropic/src/index.ts b/packages/plugin-anthropic/src/index.ts index 9c3418566c1..7cdde4c6208 100644 --- a/packages/plugin-anthropic/src/index.ts +++ b/packages/plugin-anthropic/src/index.ts @@ -20,10 +20,12 @@ export const anthropicPlugin: Plugin = { async init(config: Record) { try { const validatedConfig = await configSchema.parseAsync(config); - // Set all validated configuration values as environment variables. - Object.entries(validatedConfig).forEach(([key, value]) => { + + // Set all environment variables at once + for (const [key, value] of Object.entries(validatedConfig)) { if (value) process.env[key] = value; - }); + } + // (Optional) If the Anthropics SDK supports API key verification, // you might add a check here. } catch (error) { diff --git a/packages/plugin-openai/src/index.ts b/packages/plugin-openai/src/index.ts index f3897d2eeae..be4cf054df3 100644 --- a/packages/plugin-openai/src/index.ts +++ b/packages/plugin-openai/src/index.ts @@ -50,9 +50,9 @@ export const openaiPlugin: Plugin = { const validatedConfig = await configSchema.parseAsync(config); // Set all environment variables at once - Object.entries(validatedConfig).forEach(([key, value]) => { + for (const [key, value] of Object.entries(validatedConfig)) { if (value) process.env[key] = value; - }); + } // Verify API key const baseURL =