Skip to content

fix(AbstractGraph): instantiation of Azure GPT models #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ graphviz==0.20.3
# via scrapegraphai
greenlet==3.0.3
# via playwright
# via sqlalchemy
groq==0.9.0
# via langchain-groq
grpc-google-iam-v1==0.13.1
Expand Down
1 change: 1 addition & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ graphviz==0.20.3
# via scrapegraphai
greenlet==3.0.3
# via playwright
# via sqlalchemy
groq==0.9.0
# via langchain-groq
grpc-google-iam-v1==0.13.1
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ semchunk>=1.0.1
langchain-fireworks>=0.1.3
langchain-community>=0.2.9
langchain-huggingface>=0.0.3
browserbase==0.3.0
8 changes: 4 additions & 4 deletions scrapegraphai/graphs/abstract_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def handle_model(model_name, provider, token_key, default_token=8192):
llm_params["model"] = model_name
return init_chat_model(**llm_params)

if "azure" in llm_params["model"]:
model_name = llm_params["model"].split("/")[-1]
return handle_model(model_name, "azure_openai", model_name)

if "gpt-" in llm_params["model"]:
return handle_model(llm_params["model"], "openai", llm_params["model"])

Expand All @@ -154,10 +158,6 @@ def handle_model(model_name, provider, token_key, default_token=8192):
token_key = llm_params["model"].split("/")[-1]
return handle_model(model_name, "fireworks", token_key)

if "azure" in llm_params["model"]:
model_name = llm_params["model"].split("/")[-1]
return handle_model(model_name, "azure_openai", model_name)

if "gemini" in llm_params["model"]:
model_name = llm_params["model"].split("/")[-1]
return handle_model(model_name, "google_genai", model_name)
Expand Down
Loading