@@ -107,31 +107,29 @@ def sync_gen_func_raw_output(
107107 assert simplify_events_with_node (events ) == [
108108 (
109109 'test_workflow_agent_various_function_nodes@1/async_gen_func@1' ,
110- {'node_name' : 'async_gen_func' , ' output' : 'Hello from AsyncGen' },
110+ {'output' : 'Hello from AsyncGen' },
111111 ),
112112 (
113113 'test_workflow_agent_various_function_nodes@1/sync_func_out@1' ,
114- {'node_name' : 'sync_func_out' , ' output' : 'Hello from SyncFunc' },
114+ {'output' : 'Hello from SyncFunc' },
115115 ),
116116 (
117117 'test_workflow_agent_various_function_nodes@1/async_func_out@1' ,
118- {'node_name' : 'async_func_out' , ' output' : 'Hello from AsyncFunc' },
118+ {'output' : 'Hello from AsyncFunc' },
119119 ),
120120 (
121121 'test_workflow_agent_various_function_nodes@1/sync_gen_func@1' ,
122- {'node_name' : 'sync_gen_func' , ' output' : 'Hello from SyncGen' },
122+ {'output' : 'Hello from SyncGen' },
123123 ),
124124 (
125125 'test_workflow_agent_various_function_nodes@1/async_gen_func_raw_output@1' ,
126126 {
127- 'node_name' : 'async_gen_func_raw_output' ,
128127 'output' : 'Hello from AsyncGenRawOutput' ,
129128 },
130129 ),
131130 (
132131 'test_workflow_agent_various_function_nodes@1/sync_gen_func_raw_output@1' ,
133132 {
134- 'node_name' : 'sync_gen_func_raw_output' ,
135133 'output' : 'Hello from SyncGenRawOutput' ,
136134 },
137135 ),
@@ -165,7 +163,6 @@ def check_state_node_fn(param1: str, param2: str = 'default2') -> str:
165163 (
166164 'test_workflow_agent_state_injection@1/check_state_node_fn@1' ,
167165 {
168- 'node_name' : 'check_state_node_fn' ,
169166 'output' : 'param1=value1, param2=default2' ,
170167 },
171168 ),
@@ -247,14 +244,12 @@ def node2_fn(node_input: dict[str, Any]) -> str:
247244 (
248245 'test_workflow_agent_input_injection_dict@1/node1_fn@1' ,
249246 {
250- 'node_name' : 'node1_fn' ,
251247 'output' : {'p1' : 'value1_from_node_input' , 'p2' : 100 },
252248 },
253249 ),
254250 (
255251 'test_workflow_agent_input_injection_dict@1/node2_fn@1' ,
256252 {
257- 'node_name' : 'node2_fn' ,
258253 'output' : 'p1=value1_from_node_input, p2=100' ,
259254 },
260255 ),
@@ -293,14 +288,12 @@ def node2_fn(node_input: MyModel) -> str:
293288 (
294289 'test_workflow_agent_input_injection_pydantic@1/node1_fn@1' ,
295290 {
296- 'node_name' : 'node1_fn' ,
297291 'output' : {'p1' : 'value1_from_node_input' , 'p2' : 100 },
298292 },
299293 ),
300294 (
301295 'test_workflow_agent_input_injection_pydantic@1/node2_fn@1' ,
302296 {
303- 'node_name' : 'node2_fn' ,
304297 'output' : 'p1=value1_from_node_input, p2=100' ,
305298 },
306299 ),
@@ -361,14 +354,12 @@ def node2_fn(node_input: list) -> str:
361354 (
362355 'test_workflow_agent_input_list_no_item_type@1/node1_fn@1' ,
363356 {
364- 'node_name' : 'node1_fn' ,
365357 'output' : [1 , 2 ],
366358 },
367359 ),
368360 (
369361 'test_workflow_agent_input_list_no_item_type@1/node2_fn@1' ,
370362 {
371- 'node_name' : 'node2_fn' ,
372363 'output' : 'list=[1, 2]' ,
373364 },
374365 ),
@@ -406,12 +397,11 @@ def nodeb_fn(
406397 assert simplify_events_with_node (events ) == [
407398 (
408399 'test_node_param_injection_single_and_state@1/nodea_fn@1' ,
409- {'node_name' : 'nodea_fn' , ' output' : 'value_A' },
400+ {'output' : 'value_A' },
410401 ),
411402 (
412403 'test_node_param_injection_single_and_state@1/nodeb_fn@1' ,
413404 {
414- 'node_name' : 'nodeb_fn' ,
415405 'output' : (
416406 'node_input=value_A, p_state=value_from_state,'
417407 ' p_default=default2'
@@ -450,7 +440,6 @@ def node2_fn(my_model: MyModel) -> str:
450440 (
451441 'test_workflow_agent_state_injection_pydantic@1/node2_fn@1' ,
452442 {
453- 'node_name' : 'node2_fn' ,
454443 'output' : 'p1=value1_from_state, p2=200' ,
455444 },
456445 ),
@@ -534,7 +523,6 @@ def process_input_fn(node_input: dict[str, Any]) -> str:
534523 (
535524 'test_workflow_agent_hitl@1/request_input_fn@1' ,
536525 {
537- 'node_name' : 'request_input_fn' ,
538526 'output' : {'text' : 'Hello from user' },
539527 },
540528 ),
@@ -550,7 +538,6 @@ def process_input_fn(node_input: dict[str, Any]) -> str:
550538 (
551539 'test_workflow_agent_hitl@1/process_input_fn@1' ,
552540 {
553- 'node_name' : 'process_input_fn' ,
554541 'output' : 'received: Hello from user' ,
555542 },
556543 ),
@@ -981,15 +968,13 @@ def read_state(user_request: str) -> str:
981968 (
982969 'test_ctx_state_delta_sync@1/set_state_via_ctx@1' ,
983970 {
984- 'node_name' : 'set_state_via_ctx' ,
985971 'output' : 'done' ,
986972 'state_delta' : {'user_request' : 'build a tracker app' },
987973 },
988974 ),
989975 (
990976 'test_ctx_state_delta_sync@1/read_state@1' ,
991977 {
992- 'node_name' : 'read_state' ,
993978 'output' : 'request=build a tracker app' ,
994979 },
995980 ),
@@ -1024,15 +1009,13 @@ def read_state(counter: int, name: str) -> str:
10241009 (
10251010 'test_ctx_state_delta_async@1/set_state_via_ctx@1' ,
10261011 {
1027- 'node_name' : 'set_state_via_ctx' ,
10281012 'output' : 'set' ,
10291013 'state_delta' : {'counter' : 42 , 'name' : 'test' },
10301014 },
10311015 ),
10321016 (
10331017 'test_ctx_state_delta_async@1/read_state@1' ,
10341018 {
1035- 'node_name' : 'read_state' ,
10361019 'output' : 'counter=42, name=test' ,
10371020 },
10381021 ),
@@ -1065,15 +1048,13 @@ def read_state(my_key: str) -> str:
10651048 (
10661049 'test_ctx_state_delta_none_return@1/set_state_return_none@1' ,
10671050 {
1068- 'node_name' : 'set_state_return_none' ,
10691051 'state_delta' : {'my_key' : 'my_value' },
10701052 'output' : None ,
10711053 },
10721054 ),
10731055 (
10741056 'test_ctx_state_delta_none_return@1/read_state@1' ,
10751057 {
1076- 'node_name' : 'read_state' ,
10771058 'output' : 'my_key=my_value' ,
10781059 },
10791060 ),
@@ -1110,7 +1091,6 @@ def read_state(from_ctx: str, from_event: str) -> str:
11101091 (
11111092 'test_ctx_state_delta_event_return@1/set_state_return_event@1' ,
11121093 {
1113- 'node_name' : 'set_state_return_event' ,
11141094 'output' : 'result' ,
11151095 'state_delta' : {
11161096 'from_event' : 'event_value' ,
@@ -1121,7 +1101,6 @@ def read_state(from_ctx: str, from_event: str) -> str:
11211101 (
11221102 'test_ctx_state_delta_event_return@1/read_state@1' ,
11231103 {
1124- 'node_name' : 'read_state' ,
11251104 'output' : 'from_ctx=ctx_value, from_event=event_value' ,
11261105 },
11271106 ),
@@ -1160,23 +1139,20 @@ def read_state(key1: str, key2: str) -> str:
11601139 (
11611140 'test_ctx_state_delta_generator@1/gen_with_state@1' ,
11621141 {
1163- 'node_name' : 'gen_with_state' ,
11641142 'output' : None ,
11651143 'state_delta' : {'key1' : 'value1' },
11661144 },
11671145 ),
11681146 (
11691147 'test_ctx_state_delta_generator@1/gen_with_state@1' ,
11701148 {
1171- 'node_name' : 'gen_with_state' ,
11721149 'output' : 'done' ,
11731150 'state_delta' : {'key1' : 'value1' , 'key2' : 'value2' },
11741151 },
11751152 ),
11761153 (
11771154 'test_ctx_state_delta_generator@1/read_state@1' ,
11781155 {
1179- 'node_name' : 'read_state' ,
11801156 'output' : 'key1=value1, key2=value2' ,
11811157 },
11821158 ),
@@ -1705,11 +1681,11 @@ def produce():
17051681 assert simplify_events_with_node (events ) == [
17061682 (
17071683 'test_bind_from_node_input@1/produce@1' ,
1708- {'node_name' : 'produce' , ' output' : producer_output },
1684+ {'output' : producer_output },
17091685 ),
17101686 (
17111687 'test_bind_from_node_input@1/add@1' ,
1712- {'node_name' : 'add' , ' output' : expected_output },
1688+ {'output' : expected_output },
17131689 ),
17141690 ]
17151691
@@ -1773,11 +1749,11 @@ def greet(name: str, ctx: Context):
17731749 assert simplify_events_with_node (events ) == [
17741750 (
17751751 'test_bind_node_input_ctx@1/produce@1' ,
1776- {'node_name' : 'produce' , ' output' : {'name' : 'Alice' }},
1752+ {'output' : {'name' : 'Alice' }},
17771753 ),
17781754 (
17791755 'test_bind_node_input_ctx@1/greet@1' ,
1780- {'node_name' : 'greet' , ' output' : 'Hello, Alice!' },
1756+ {'output' : 'Hello, Alice!' },
17811757 ),
17821758 ]
17831759
0 commit comments