Skip to content

Commit 786af99

Browse files
committed
fix(AbstractGraph): LangChain warnings handling, Mistral tokens
1 parent 07720b6 commit 786af99

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

scrapegraphai/graphs/abstract_graph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from abc import ABC, abstractmethod
66
from typing import Optional
77
import uuid
8+
import warnings
89
from pydantic import BaseModel
910

1011
from langchain_community.chat_models import ErnieBotChat
@@ -144,7 +145,9 @@ def handle_model(model_name, provider, token_key, default_token=8192):
144145
self.model_token = default_token
145146
llm_params["model_provider"] = provider
146147
llm_params["model"] = model_name
147-
return init_chat_model(**llm_params)
148+
with warnings.catch_warnings():
149+
warnings.simplefilter("ignore")
150+
return init_chat_model(**llm_params)
148151

149152
if "azure" in llm_params["model"]:
150153
model_name = llm_params["model"].split("/")[-1]

scrapegraphai/helpers/models_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"cohere.embed-english-v3": 512,
146146
"cohere.embed-multilingual-v3": 512
147147
},
148-
"mistral": {
148+
"mistralai": {
149149
"mistral-large-latest": 128000,
150150
"open-mistral-nemo": 128000,
151151
"codestral-latest": 32000,

0 commit comments

Comments
 (0)