Skip to content

Commit 3837d9f

Browse files
committed
fix: storage scoped to runtime id
1 parent 7a3cc61 commit 3837d9f

7 files changed

Lines changed: 1456 additions & 36 deletions

File tree

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.1.8"
3+
version = "0.2.0"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
@@ -10,7 +10,8 @@ dependencies = [
1010
"llama-index-embeddings-azure-openai>=0.4.1",
1111
"llama-index-llms-azure-openai>=0.4.2",
1212
"openinference-instrumentation-llama-index>=4.3.9",
13-
"uipath>=2.2.26, <2.3.0",
13+
"uipath>=2.3.0, <2.4.0",
14+
"uipath-runtime>=0.3.1, <0.4.0",
1415
]
1516
classifiers = [
1617
"Intended Audience :: Developers",
@@ -58,6 +59,7 @@ dev = [
5859
"pytest-cov>=4.1.0",
5960
"pytest-mock>=3.11.1",
6061
"pre-commit>=4.1.0",
62+
"pytest-asyncio>=1.0.0",
6163
"numpy>=1.24.0",
6264
]
6365

@@ -98,10 +100,11 @@ disallow_untyped_defs = false
98100
testpaths = ["tests"]
99101
python_files = "test_*.py"
100102
addopts = "-ra -q"
103+
asyncio_default_fixture_loop_scope = "function"
104+
asyncio_mode = "auto"
101105

102106
[[tool.uv.index]]
103107
name = "testpypi"
104108
url = "https://test.pypi.org/simple/"
105109
publish-url = "https://test.pypi.org/legacy/"
106110
explicit = true
107-

src/uipath_llamaindex/runtime/factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ async def _create_runtime_instance(
260260
delegate=base_runtime,
261261
storage=storage,
262262
trigger_manager=trigger_manager,
263+
runtime_id=runtime_id,
263264
)
264265

265266
async def new_runtime(

src/uipath_llamaindex/runtime/runtime.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ async def _run_workflow(
138138
Core workflow execution logic used by both execute() and stream().
139139
"""
140140
workflow_input = input or {}
141-
142141
is_resuming = bool(options and options.resume)
143142

144143
if is_resuming:
@@ -154,7 +153,11 @@ async def _run_workflow(
154153
if is_resuming:
155154
handler: WorkflowHandler = self.workflow.run(ctx=self._context)
156155
if workflow_input:
157-
handler.ctx.send_event(HumanResponseEvent(**workflow_input))
156+
handler.ctx.send_event(
157+
HumanResponseEvent(
158+
**workflow_input.get(self.runtime_id, workflow_input)
159+
)
160+
)
158161
else:
159162
handler.ctx.send_event(BreakpointResumeEvent())
160163
else:
@@ -267,13 +270,14 @@ def _create_suspended_result(
267270
if hasattr(event, "_data") and "prefix" in event._data:
268271
prefix = event._data["prefix"]
269272

273+
resume_map = {self.runtime_id: prefix or ""}
270274
return UiPathRuntimeResult(
271-
output=prefix,
275+
output=resume_map,
272276
status=UiPathRuntimeStatus.SUSPENDED,
273277
)
274278

275279
return UiPathRuntimeResult(
276-
output=event,
280+
output={self.runtime_id: event},
277281
status=UiPathRuntimeStatus.SUSPENDED,
278282
)
279283

0 commit comments

Comments
 (0)