Skip to content

Commit 7d07f66

Browse files
authored
refactor(nodes)!: rename typed constructor config to data (#48)
1 parent f170b08 commit 7d07f66

23 files changed

Lines changed: 51 additions & 51 deletions

File tree

examples/graphon_openai_slim/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def build_graph(
255255
) -> Graph:
256256
start_node = StartNode(
257257
node_id="start",
258-
config=StartNodeData(
258+
data=StartNodeData(
259259
title="Start",
260260
variables=[
261261
VariableEntity(
@@ -272,7 +272,7 @@ def build_graph(
272272

273273
llm_node = LLMNode(
274274
node_id="llm",
275-
config=LLMNodeData(
275+
data=LLMNodeData(
276276
title="LLM",
277277
model=ModelConfig(
278278
provider=provider,
@@ -300,7 +300,7 @@ def build_graph(
300300

301301
output_node = AnswerNode(
302302
node_id="output",
303-
config=AnswerNodeData(
303+
data=AnswerNodeData(
304304
title="Output",
305305
answer="{{#llm.text#}}",
306306
),

src/graphon/nodes/base/node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def node_data_from_mapping(
183183
184184
This convenience wrapper keeps direct node construction ergonomic for
185185
callers that naturally start from plain dictionaries while preserving the
186-
stricter `Node.__init__(..., config=NodeDataT, ...)` contract.
186+
stricter `Node.__init__(..., data=NodeDataT, ...)` contract.
187187
188188
Returns:
189189
The validated node data instance for the concrete node subclass.
@@ -552,7 +552,7 @@ def _get_node_data_type(cls: type[Node[NodeDataT]]) -> type[NodeDataT]:
552552
def __init__(
553553
self,
554554
node_id: str,
555-
config: NodeDataT,
555+
data: NodeDataT,
556556
*,
557557
graph_init_params: GraphInitParams,
558558
graph_runtime_state: GraphRuntimeState,
@@ -574,7 +574,7 @@ def __init__(
574574
self._node_execution_id: str = ""
575575
self._start_at = datetime.now(UTC).replace(tzinfo=None)
576576

577-
self._node_data = self.validate_node_data(config)
577+
self._node_data = self.validate_node_data(data)
578578

579579
self.post_init()
580580

src/graphon/nodes/code/code_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class CodeNode(Node[CodeNodeData]):
8282
def __init__(
8383
self,
8484
node_id: str,
85-
config: CodeNodeData,
85+
data: CodeNodeData,
8686
*,
8787
graph_init_params: GraphInitParams,
8888
graph_runtime_state: GraphRuntimeState,
@@ -91,7 +91,7 @@ def __init__(
9191
) -> None:
9292
super().__init__(
9393
node_id=node_id,
94-
config=config,
94+
data=data,
9595
graph_init_params=graph_init_params,
9696
graph_runtime_state=graph_runtime_state,
9797
)

src/graphon/nodes/document_extractor/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def version(cls) -> str:
249249
def __init__(
250250
self,
251251
node_id: str,
252-
config: DocumentExtractorNodeData,
252+
data: DocumentExtractorNodeData,
253253
*,
254254
graph_init_params: GraphInitParams,
255255
graph_runtime_state: GraphRuntimeState,
@@ -258,7 +258,7 @@ def __init__(
258258
) -> None:
259259
super().__init__(
260260
node_id=node_id,
261-
config=config,
261+
data=data,
262262
graph_init_params=graph_init_params,
263263
graph_runtime_state=graph_runtime_state,
264264
)

src/graphon/nodes/http_request/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class HttpRequestNode(Node[HttpRequestNodeData]):
5555
def __init__(
5656
self,
5757
node_id: str,
58-
config: HttpRequestNodeData,
58+
data: HttpRequestNodeData,
5959
*,
6060
graph_init_params: GraphInitParams,
6161
graph_runtime_state: GraphRuntimeState,
@@ -68,7 +68,7 @@ def __init__(
6868
) -> None:
6969
super().__init__(
7070
node_id=node_id,
71-
config=config,
71+
data=data,
7272
graph_init_params=graph_init_params,
7373
graph_runtime_state=graph_runtime_state,
7474
)

src/graphon/nodes/human_input/human_input_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class HumanInputNode(Node[HumanInputNodeData]):
6565
def __init__(
6666
self,
6767
node_id: str,
68-
config: HumanInputNodeData,
68+
data: HumanInputNodeData,
6969
*,
7070
graph_init_params: GraphInitParams,
7171
graph_runtime_state: GraphRuntimeState,
@@ -77,7 +77,7 @@ def __init__(
7777
) -> None:
7878
super().__init__(
7979
node_id=node_id,
80-
config=config,
80+
data=data,
8181
graph_init_params=graph_init_params,
8282
graph_runtime_state=graph_runtime_state,
8383
)

src/graphon/nodes/llm/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class LLMNode(Node[LLMNodeData]):
128128
def __init__(
129129
self,
130130
node_id: str,
131-
config: LLMNodeData,
131+
data: LLMNodeData,
132132
*,
133133
graph_init_params: GraphInitParams,
134134
graph_runtime_state: GraphRuntimeState,
@@ -145,7 +145,7 @@ def __init__(
145145
) -> None:
146146
super().__init__(
147147
node_id=node_id,
148-
config=config,
148+
data=data,
149149
graph_init_params=graph_init_params,
150150
graph_runtime_state=graph_runtime_state,
151151
)

src/graphon/nodes/parameter_extractor/parameter_extractor_node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class ParameterExtractorNode(Node[ParameterExtractorNodeData]):
147147
def __init__(
148148
self,
149149
node_id: str,
150-
config: ParameterExtractorNodeData,
150+
data: ParameterExtractorNodeData,
151151
*,
152152
graph_init_params: GraphInitParams,
153153
graph_runtime_state: GraphRuntimeState,
@@ -163,7 +163,7 @@ def __init__(
163163
def __init__(
164164
self,
165165
node_id: str,
166-
config: ParameterExtractorNodeData,
166+
data: ParameterExtractorNodeData,
167167
*,
168168
graph_init_params: GraphInitParams,
169169
graph_runtime_state: GraphRuntimeState,
@@ -179,7 +179,7 @@ def __init__(
179179
def __init__(
180180
self,
181181
node_id: str,
182-
config: ParameterExtractorNodeData,
182+
data: ParameterExtractorNodeData,
183183
*,
184184
graph_init_params: GraphInitParams,
185185
graph_runtime_state: GraphRuntimeState,
@@ -192,7 +192,7 @@ def __init__(
192192
) -> None:
193193
super().__init__(
194194
node_id=node_id,
195-
config=config,
195+
data=data,
196196
graph_init_params=graph_init_params,
197197
graph_runtime_state=graph_runtime_state,
198198
)

src/graphon/nodes/question_classifier/question_classifier_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class QuestionClassifierNode(Node[QuestionClassifierNodeData]):
105105
def __init__(
106106
self,
107107
node_id: str,
108-
config: QuestionClassifierNodeData,
108+
data: QuestionClassifierNodeData,
109109
*,
110110
graph_init_params: GraphInitParams,
111111
graph_runtime_state: GraphRuntimeState,
@@ -121,7 +121,7 @@ def __init__(
121121
) -> None:
122122
super().__init__(
123123
node_id=node_id,
124-
config=config,
124+
data=data,
125125
graph_init_params=graph_init_params,
126126
graph_runtime_state=graph_runtime_state,
127127
)

src/graphon/nodes/template_transform/template_transform_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TemplateTransformNode(Node[TemplateTransformNodeData]):
3737
def __init__(
3838
self,
3939
node_id: str,
40-
config: TemplateTransformNodeData,
40+
data: TemplateTransformNodeData,
4141
*,
4242
graph_init_params: GraphInitParams,
4343
graph_runtime_state: GraphRuntimeState,
@@ -46,7 +46,7 @@ def __init__(
4646
) -> None:
4747
super().__init__(
4848
node_id=node_id,
49-
config=config,
49+
data=data,
5050
graph_init_params=graph_init_params,
5151
graph_runtime_state=graph_runtime_state,
5252
)

0 commit comments

Comments
 (0)