fix: typing fixes
This commit is contained in:
parent
8ea37c5bc0
commit
9b6c9fd8eb
3 changed files with 3 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ def get_signature(name: str, object_type: str):
|
||||||
"agents": get_agent_signature,
|
"agents": get_agent_signature,
|
||||||
"prompts": get_prompt_signature,
|
"prompts": get_prompt_signature,
|
||||||
"llms": get_llm_signature,
|
"llms": get_llm_signature,
|
||||||
"memories": get_memory_signature,
|
# "memories": get_memory_signature,
|
||||||
"tools": get_tool_signature,
|
"tools": get_tool_signature,
|
||||||
}.get(object_type, lambda name: f"Invalid type: {name}")(name)
|
}.get(object_type, lambda name: f"Invalid type: {name}")(name)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ def get_type_list():
|
||||||
"""Get a list of all langchain types"""
|
"""Get a list of all langchain types"""
|
||||||
all_types = build_langchain_types_dict()
|
all_types = build_langchain_types_dict()
|
||||||
|
|
||||||
all_types.pop("tools")
|
# all_types.pop("tools")
|
||||||
|
|
||||||
for key, value in all_types.items():
|
for key, value in all_types.items():
|
||||||
all_types[key] = [item["template"]["_type"] for item in value.values()]
|
all_types[key] = [item["template"]["_type"] for item in value.values()]
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import contextlib
|
||||||
import re
|
import re
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from langflow.utils.graph import Graph, Node
|
|
||||||
|
|
||||||
|
|
||||||
def extract_input_variables(nodes):
|
def extract_input_variables(nodes):
|
||||||
"""
|
"""
|
||||||
|
|
@ -38,7 +36,7 @@ def get_root_node(graph):
|
||||||
return next((node for node in graph.nodes if node not in incoming_edges), None)
|
return next((node for node in graph.nodes if node not in incoming_edges), None)
|
||||||
|
|
||||||
|
|
||||||
def build_json(root: Node, graph: Graph) -> Dict:
|
def build_json(root, graph) -> Dict:
|
||||||
if "node" not in root.data:
|
if "node" not in root.data:
|
||||||
# If the root node has no "node" key, then it has only one child,
|
# If the root node has no "node" key, then it has only one child,
|
||||||
# which is the target of the single outgoing edge
|
# which is the target of the single outgoing edge
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue