Skip to content
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
6 changes: 3 additions & 3 deletions examples/graphon_openai_slim/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def build_graph(
) -> Graph:
start_node = StartNode(
node_id="start",
config=StartNodeData(
data=StartNodeData(
title="Start",
variables=[
VariableEntity(
Expand All @@ -272,7 +272,7 @@ def build_graph(

llm_node = LLMNode(
node_id="llm",
config=LLMNodeData(
data=LLMNodeData(
title="LLM",
model=ModelConfig(
provider=provider,
Expand Down Expand Up @@ -300,7 +300,7 @@ def build_graph(

output_node = AnswerNode(
node_id="output",
config=AnswerNodeData(
data=AnswerNodeData(
title="Output",
answer="{{#llm.text#}}",
),
Expand Down
6 changes: 3 additions & 3 deletions src/graphon/nodes/base/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def node_data_from_mapping(

This convenience wrapper keeps direct node construction ergonomic for
callers that naturally start from plain dictionaries while preserving the
stricter `Node.__init__(..., config=NodeDataT, ...)` contract.
stricter `Node.__init__(..., data=NodeDataT, ...)` contract.

Returns:
The validated node data instance for the concrete node subclass.
Expand Down Expand Up @@ -552,7 +552,7 @@ def _get_node_data_type(cls: type[Node[NodeDataT]]) -> type[NodeDataT]:
def __init__(
self,
node_id: str,
config: NodeDataT,
data: NodeDataT,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -574,7 +574,7 @@ def __init__(
self._node_execution_id: str = ""
self._start_at = datetime.now(UTC).replace(tzinfo=None)

self._node_data = self.validate_node_data(config)
self._node_data = self.validate_node_data(data)

self.post_init()

Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/code/code_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CodeNode(Node[CodeNodeData]):
def __init__(
self,
node_id: str,
config: CodeNodeData,
data: CodeNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -91,7 +91,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/document_extractor/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def version(cls) -> str:
def __init__(
self,
node_id: str,
config: DocumentExtractorNodeData,
data: DocumentExtractorNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -258,7 +258,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/http_request/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HttpRequestNode(Node[HttpRequestNodeData]):
def __init__(
self,
node_id: str,
config: HttpRequestNodeData,
data: HttpRequestNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -68,7 +68,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/human_input/human_input_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class HumanInputNode(Node[HumanInputNodeData]):
def __init__(
self,
node_id: str,
config: HumanInputNodeData,
data: HumanInputNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -77,7 +77,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/llm/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class LLMNode(Node[LLMNodeData]):
def __init__(
self,
node_id: str,
config: LLMNodeData,
data: LLMNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -145,7 +145,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ParameterExtractorNode(Node[ParameterExtractorNodeData]):
def __init__(
self,
node_id: str,
config: ParameterExtractorNodeData,
data: ParameterExtractorNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -163,7 +163,7 @@ def __init__(
def __init__(
self,
node_id: str,
config: ParameterExtractorNodeData,
data: ParameterExtractorNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -179,7 +179,7 @@ def __init__(
def __init__(
self,
node_id: str,
config: ParameterExtractorNodeData,
data: ParameterExtractorNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -192,7 +192,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class QuestionClassifierNode(Node[QuestionClassifierNodeData]):
def __init__(
self,
node_id: str,
config: QuestionClassifierNodeData,
data: QuestionClassifierNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -121,7 +121,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TemplateTransformNode(Node[TemplateTransformNodeData]):
def __init__(
self,
node_id: str,
config: TemplateTransformNodeData,
data: TemplateTransformNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -46,7 +46,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/tool/tool_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ToolNode(Node[ToolNodeData]):
def __init__(
self,
node_id: str,
config: ToolNodeData,
data: ToolNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
Expand All @@ -72,7 +72,7 @@ def __init__(
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/variable_assigner/v1/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class VariableAssignerNode(Node[VariableAssignerData]):
def __init__(
self,
node_id: str,
config: VariableAssignerData,
data: VariableAssignerData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
4 changes: 2 additions & 2 deletions src/graphon/nodes/variable_assigner/v2/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ class VariableAssignerNode(Node[VariableAssignerNodeData]):
def __init__(
self,
node_id: str,
config: VariableAssignerNodeData,
data: VariableAssignerNodeData,
*,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down
6 changes: 3 additions & 3 deletions tests/graph/test_graph_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def __init__(
self,
*,
node_id: str,
config: _TestNodeData,
data: _TestNodeData,
graph_init_params: GraphInitParams,
graph_runtime_state: GraphRuntimeState,
) -> None:
super().__init__(
node_id=node_id,
config=config,
data=data,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
)
Expand Down Expand Up @@ -78,7 +78,7 @@ class _SimpleNodeFactory:
def create_node(self, node_config: NodeConfigDict) -> _TestNode:
return _TestNode(
node_id=str(node_config["id"]),
config=_TestNode.validate_node_data(node_config["data"]),
data=_TestNode.validate_node_data(node_config["data"]),
graph_init_params=self.graph_init_params,
graph_runtime_state=self.graph_runtime_state,
)
Expand Down
10 changes: 5 additions & 5 deletions tests/http/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_set_http_client_updates_process_default() -> None:
def test_http_request_node_accepts_public_dependency_bundle() -> None:
node = HttpRequestNode(
node_id="http",
config=HttpRequestNodeData(
data=HttpRequestNodeData(
title="HTTP Request",
method="get",
url="https://example.com",
Expand All @@ -261,7 +261,7 @@ def test_http_request_node_rejects_mixed_dependency_inputs() -> None:
):
HttpRequestNode(
node_id="http",
config=HttpRequestNodeData(
data=HttpRequestNodeData(
title="HTTP Request",
method="get",
url="https://example.com",
Expand All @@ -286,7 +286,7 @@ def test_http_request_node_uses_configured_default_http_client() -> None:

node = HttpRequestNode(
node_id="http",
config=HttpRequestNodeData(
data=HttpRequestNodeData(
title="HTTP Request",
method="get",
url="https://example.com",
Expand All @@ -311,7 +311,7 @@ def test_http_request_node_uses_configured_default_http_client() -> None:
def test_document_extractor_node_uses_default_http_client_when_not_injected() -> None:
node = DocumentExtractorNode(
node_id="extractor",
config=DocumentExtractorNodeData(
data=DocumentExtractorNodeData(
title="Document Extractor",
variable_selector=["inputs", "file"],
),
Expand All @@ -330,7 +330,7 @@ def test_document_extractor_node_uses_configured_default_http_client() -> None:

node = DocumentExtractorNode(
node_id="extractor",
config=DocumentExtractorNodeData(
data=DocumentExtractorNodeData(
title="Document Extractor",
variable_selector=["inputs", "file"],
),
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/human_input/test_human_input_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _build_node(*, form: _FakeForm) -> HumanInputNode:
)
return HumanInputNode(
node_id="human_input_node",
config=node_data,
data=node_data,
graph_init_params=_build_graph_init_params(),
graph_runtime_state=GraphRuntimeState(
variable_pool=VariablePool(),
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/if_else/test_if_else_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _run_if_else_node(
)
node = IfElseNode(
node_id="if-node",
config=IfElseNode.validate_node_data(data),
data=IfElseNode.validate_node_data(data),
graph_init_params=build_graph_init_params(
graph_config={"nodes": [], "edges": []},
),
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/llm/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def _build_llm_node() -> LLMNode:
return LLMNode(
node_id="llm",
config=LLMNodeData.model_validate({
data=LLMNodeData.model_validate({
"title": "LLM",
"model": {
"provider": "openai",
Expand Down
Loading
Loading