Replies: 3 comments 3 replies
-
🤖 Hello, From the context provided, it seems that the If you want to use OpenAI instead of Azure, you can set the import os
os.environ["OPENAI_API_TYPE"] = "openai"
os.environ["OPENAI_API_KEY"] = "your-openai-api-key" Replace After setting these environment variables, you can instantiate the from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(openai_api_key=os.environ["OPENAI_API_KEY"]) This should instantiate the Please note that this solution is based on the current implementation of the I hope this helps! If you have any further questions, please feel free to ask. Best regards, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
does not really work: -->throws an exception: which mean it still instantiate it as azure one! or maybe the exception means something else ? |
Beta Was this translation helpful? Give feedback.
-
@wiswis15 Tried to reproduce your error using your snippet, to no avail. Can you provide a meaningful reproducible example which leads to the above error when you transition from Azure to "standard" OpenAI? |
Beta Was this translation helpful? Give feedback.
-
inside my project Im using asure open ai in some parts, but for a specific part, Im trying to use the langchain.embeddings.OpenAIEmbeddings class. with open ai and not azure.
when i do like this
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings.(openai_api_key=key)
it always instantiate it with azure, and then asks for the resource for example.
can anyone help please ?
Beta Was this translation helpful? Give feedback.
All reactions