fix(AbstractGraph): instantiation of Azure GPT models
Some checks failed
/ build (push) Has been cancelled

Closes #498
This commit is contained in:
Federico Aguzzi 2024-08-02 12:15:43 +02:00
parent 3e07f6273f
commit ade28fca2c
4 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -146,6 +146,10 @@ class AbstractGraph(ABC):
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"])
@ -154,10 +158,6 @@ class AbstractGraph(ABC):
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)