Update abstract_graph.py

fix: Incorrect API Key Error with OpenAI Proxy
This commit is contained in:
shubihu 2024-06-17 16:26:33 +08:00 committed by GitHub
parent 44fbd71742
commit d8d5cd267a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -298,7 +298,7 @@ class AbstractGraph(ABC):
google_api_key=llm_config["api_key"], model="models/embedding-001"
)
if isinstance(self.llm_model, OpenAI):
return OpenAIEmbeddings(api_key=self.llm_model.openai_api_key)
return OpenAIEmbeddings(api_key=self.llm_model.openai_api_key, base_url=self.llm_model.openai_api_base)
elif isinstance(self.llm_model, DeepSeek):
return OpenAIEmbeddings(api_key=self.llm_model.openai_api_key)
elif isinstance(self.llm_model, AzureOpenAIEmbeddings):
@ -407,4 +407,4 @@ class AbstractGraph(ABC):
"""
Abstract method to execute the graph and return the result.
"""
pass
pass