Skip to content

Commit

Permalink
fix(openai): Check configuration.apiKey in ChatOpenAI constructor (
Browse files Browse the repository at this point in the history
  • Loading branch information
ezra-chu authored Sep 4, 2024
1 parent f5e2c4a commit 40b85da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ export class ChatOpenAI<
this.openAIApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.configuration?.apiKey ??
getEnvironmentVariable("OPENAI_API_KEY");
this.apiKey = this.openAIApiKey;

Expand Down

0 comments on commit 40b85da

Please sign in to comment.