You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing the api_key to OpenAIEmbedder does not work
Steps to Reproduce
OpenAIEmbedder(api_key="<api_key>")
Agent Configuration (if applicable)
KnowledgeBase with pgVector
Expected Behavior
What did you expect to happen?
It should use the api_key passed as parameter, instead of depending on env variable
Actual Behavior
What actually happened instead?
It throws an error that api_key is not set
Screenshots or Logs (if applicable)
UserWarning: Failed to load OpenAIEmbeddings: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable. Falling back to default <class 'chonkie.embeddings.openai.OpenAIEmbeddings'> model
Hi @kidrahdev , Thanks for reaching out. Unfortunately we are not able to replicate the issue on our end. Can you please confirm once that you have not set your OPENAI_API_KEY to empty or something else?
I can confirm that, if I set it to env variables my code works but if I don't set anything and pass the same key as a parameter the above error is thrown
Description
Passing the api_key to OpenAIEmbedder does not work
Steps to Reproduce
OpenAIEmbedder(api_key="<api_key>")
Agent Configuration (if applicable)
KnowledgeBase with pgVector
Expected Behavior
What did you expect to happen?
It should use the api_key passed as parameter, instead of depending on env variable
Actual Behavior
What actually happened instead?
It throws an error that api_key is not set
Screenshots or Logs (if applicable)
Environment
Possible Solutions (optional)
Suggest any ideas you might have to fix or address the issue.
Additional Context
Add any other context or details about the problem here.
The text was updated successfully, but these errors were encountered: