Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add description on graph #3371

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/backend/base/langflow/graph/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(
end: Optional["Component"] = None,
flow_id: Optional[str] = None,
flow_name: Optional[str] = None,
description: Optional[str] = None,
user_id: Optional[str] = None,
log_config: Optional[LogConfig] = None,
) -> None:
Expand All @@ -70,6 +71,7 @@ def __init__(
self._updates = 0
self.flow_id = flow_id
self.flow_name = flow_name
self.description = description
self.user_id = user_id
self._is_input_vertices: List[str] = []
self._is_output_vertices: List[str] = []
Expand Down Expand Up @@ -170,10 +172,13 @@ def dump(
}
if name:
graph_dict["name"] = name
elif name is None and self.flow_name:
graph_dict["name"] = self.flow_name
if description:
graph_dict["description"] = description
if endpoint_name:
graph_dict["endpoint_name"] = endpoint_name
elif description is None and self.description:
graph_dict["description"] = self.description
graph_dict["endpoint_name"] = str(endpoint_name)
return graph_dict

def add_nodes_and_edges(self, nodes: List[NodeData], edges: List[EdgeData]):
Expand Down Expand Up @@ -841,6 +846,7 @@ def __getstate__(self):
"edges": self.edges,
"flow_id": self.flow_id,
"flow_name": self.flow_name,
"description": self.description,
"user_id": self.user_id,
"raw_graph_data": self.raw_graph_data,
"top_level_vertices": self.top_level_vertices,
Expand Down
1 change: 0 additions & 1 deletion src/backend/base/langflow/graph/vertex/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ class NodeData(TypedDict):
positionAbsolute: NotRequired[Position]
selected: NotRequired[bool]
parent_node_id: NotRequired[str]
type: str
Loading