File tree Expand file tree Collapse file tree
packages/uipath-llamaindex/src/uipath_llamaindex/runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ async def _run_workflow(
143143 workflow_input = UiPathChatMessagesMapper .map_input (input or {})
144144 is_resuming = bool (options and options .resume )
145145
146- if is_resuming :
147- self ._context = await self ._load_context ()
148- else :
149- self ._context = Context (self .workflow )
146+ self ._context = await self ._load_context ()
150147
151148 # Make the Context discoverable from inside steps
152149 if self .debug_mode and self ._context is not None :
@@ -241,7 +238,9 @@ async def _run_workflow(
241238 else :
242239 yield self ._create_suspended_result (suspended_event )
243240 else :
244- yield self ._create_success_result (await handler )
241+ final_result = await handler
242+ await self ._save_context ()
243+ yield self ._create_success_result (final_result )
245244
246245 async def get_schema (self ) -> UiPathRuntimeSchema :
247246 """Get schema for this LlamaIndex runtime."""
You can’t perform that action at this time.
0 commit comments