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 =