@@ -181,22 +181,22 @@ async def main():
181
181
start = start_node ,
182
182
)
183
183
)
184
- while True :
185
- next_node = await self . next ( start_node , history , state = state , deps = deps , infer_name = False )
186
- if isinstance ( next_node , End ) :
187
- history . append ( EndStep ( result = next_node ) )
188
- if run_span is not None :
189
- run_span . set_attribute ( 'history' , history )
190
- return next_node . data , history
191
- elif isinstance ( next_node , BaseNode ):
192
- start_node = next_node
193
- else :
194
- if TYPE_CHECKING :
195
- typing_extensions .assert_never (next_node )
196
- else :
197
- raise exceptions .GraphRuntimeError (
198
- f'Invalid node return type: `{ type (next_node ).__name__ } `. Expected `BaseNode` or `End`.'
199
- )
184
+
185
+ next_node = start_node
186
+ while True :
187
+ next_node = await self . next ( next_node , history , state = state , deps = deps , infer_name = False )
188
+ if isinstance ( next_node , End ) :
189
+ history . append ( EndStep ( result = next_node ) )
190
+ if run_span is not None :
191
+ run_span . set_attribute ( 'history' , history )
192
+ return next_node . data , history
193
+ elif not isinstance ( next_node , BaseNode ) :
194
+ if TYPE_CHECKING :
195
+ typing_extensions .assert_never (next_node )
196
+ else :
197
+ raise exceptions .GraphRuntimeError (
198
+ f'Invalid node return type: `{ type (next_node ).__name__ } `. Expected `BaseNode` or `End`.'
199
+ )
200
200
201
201
def run_sync (
202
202
self : Graph [StateT , DepsT , T ],
0 commit comments