Skip to content

Python scraper based on AI

Fix: Azure OpenAI issue

aziz-ullah-khana92b9c697004
diff --git a/scrapegraphai/graphs/abstract_graph.py b/scrapegraphai/graphs/abstract_graph.py
index ae1e90b2..8434a0b6 100644
--- a/scrapegraphai/graphs/abstract_graph.py
+++ b/scrapegraphai/graphs/abstract_graph.py
@@ -153,6 +153,10 @@ class AbstractGraph(ABC):
raise ValueError(f"Model '{llm_params['model']}' is not supported")
try:
+ if "azure" in llm_params["model"]:
+ model_name = llm_params["model"].split("/")[-1]
+ return handle_model(model_name, "azure_openai", model_name)
+
if "fireworks" in llm_params["model"]:
model_name = "/".join(llm_params["model"].split("/")[1:])
token_key = llm_params["model"].split("/")[-1]
@@ -271,4 +275,4 @@ class AbstractGraph(ABC):
def run(self) -> str:
"""
Abstract method to execute the graph and return the result.
- """
\ No newline at end of file
+ """