OpenAI or Azure OpenAI API key not found (Cannot set apiKey - ENV works fine) #5713
Closed
5 tasks done
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Error: OpenAI or Azure OpenAI API key not found\n' +
' at new OpenAIChat ([redacted]\node_modules\@langchain\openai\dist\legacy.cjs:235:19)\n' +
' at new OpenAI ([redacted]\node_modules\@langchain\openai\dist\llms.cjs:79:20)\n' +
rest redacted
Description
Setting the ENV: OPENAI_API_KEY the creating an model works fine, but passing a string fails.
This is only for
new OpenAI()
new OpenAIEmbeddings()
works fine to pass an apiKey string inSystem Info
Windows
NPM 10.5.0
Node v20.12.2
The text was updated successfully, but these errors were encountered: