refac: fix linting
This commit is contained in:
parent
df194720d2
commit
5a36a778ba
2 changed files with 1 additions and 11 deletions
|
|
@ -92,7 +92,7 @@ def load_agent_executor_from_config(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def load_tools_from_config(tool_list: list[dict]) -> list[Tool]:
|
def load_tools_from_config(tool_list: list[dict]) -> list:
|
||||||
"""Load tools based on a config list.
|
"""Load tools based on a config list.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ from langchain.agents.load_tools import (
|
||||||
_LLM_TOOLS,
|
_LLM_TOOLS,
|
||||||
get_all_tool_names,
|
get_all_tool_names,
|
||||||
)
|
)
|
||||||
from langchain.chains.conversation import memory as memories
|
|
||||||
|
|
||||||
from langflow_backend.utils import util
|
from langflow_backend.utils import util
|
||||||
from langflow_backend.custom import customs
|
from langflow_backend.custom import customs
|
||||||
|
|
@ -21,7 +20,6 @@ def get_signature(name: str, object_type: str):
|
||||||
"prompts": get_prompt_signature,
|
"prompts": get_prompt_signature,
|
||||||
"llms": get_llm_signature,
|
"llms": get_llm_signature,
|
||||||
"tools": get_tool_signature,
|
"tools": get_tool_signature,
|
||||||
"memories": get_memory_signature,
|
|
||||||
}.get(object_type, lambda name: f"Invalid type: {name}")(name)
|
}.get(object_type, lambda name: f"Invalid type: {name}")(name)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,14 +61,6 @@ def get_llm_signature(name: str):
|
||||||
raise ValueError("LLM not found") from exc
|
raise ValueError("LLM not found") from exc
|
||||||
|
|
||||||
|
|
||||||
def get_memory_signature(name: str):
|
|
||||||
"""Get the signature of a memory."""
|
|
||||||
try:
|
|
||||||
return util.build_template_from_class(name, memories.type_to_cls_dict)
|
|
||||||
except ValueError as exc:
|
|
||||||
raise ValueError("Memory not found") from exc
|
|
||||||
|
|
||||||
|
|
||||||
def get_tool_signature(name: str):
|
def get_tool_signature(name: str):
|
||||||
"""Get the signature of a tool."""
|
"""Get the signature of a tool."""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue