🔧 fix(llm.py): ignore type error for service_account import
🔧 fix(loading.py): remove empty lines
The type error for the service_account import in llm.py is ignored to prevent a linting error. In loading.py, empty lines were removed for code cleanliness.
This commit is contained in:
parent
cbfc9cb405
commit
1689eb0be4
2 changed files with 2 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
def initialize_vertexai(class_object, params):
|
||||
if credentials_path := params.get("credentials"):
|
||||
from google.oauth2 import service_account
|
||||
from google.oauth2 import service_account # type: ignore
|
||||
|
||||
credentials_object = service_account.Credentials.from_service_account_file(
|
||||
filename=credentials_path
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ def instantiate_llm(node_type, class_object, params: Dict):
|
|||
if node_type == "VertexAI":
|
||||
return initialize_vertexai(class_object=class_object, params=params)
|
||||
|
||||
|
||||
def instantiate_memory(node_type, class_object, params):
|
||||
try:
|
||||
return class_object(**params)
|
||||
|
|
@ -125,9 +126,6 @@ def instantiate_retriever(node_type, class_object, params):
|
|||
return class_object(**params)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def instantiate_chains(node_type, class_object: Type[Chain], params: Dict):
|
||||
if "retriever" in params and hasattr(params["retriever"], "as_retriever"):
|
||||
params["retriever"] = params["retriever"].as_retriever()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue