Skip to content

Commit

Permalink
just minor biome pref
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo committed Feb 12, 2025
1 parent d4a5a36 commit af52209
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions packages/plugin-anthropic/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ export const anthropicPlugin: Plugin = {
async init(config: Record<string, string>) {
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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-openai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit af52209

Please sign in to comment.