From d8d5cd267ae89764490a427f94afc9df3beae536 Mon Sep 17 00:00:00 2001 From: shubihu <36021958+shubihu@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:26:33 +0800 Subject: [PATCH] Update abstract_graph.py fix: Incorrect API Key Error with OpenAI Proxy --- scrapegraphai/graphs/abstract_graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapegraphai/graphs/abstract_graph.py b/scrapegraphai/graphs/abstract_graph.py index b5f3a681..87a00f9b 100644 --- a/scrapegraphai/graphs/abstract_graph.py +++ b/scrapegraphai/graphs/abstract_graph.py @@ -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 \ No newline at end of file + pass