Skip to content

Commit 041ada2

Browse files
committed
feat: pass input and output file to runtime executor
1 parent e6fc7fd commit 041ada2

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.0.30"
3+
version = "0.0.31"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
@@ -9,7 +9,7 @@ dependencies = [
99
"llama-index-embeddings-azure-openai>=0.3.8",
1010
"llama-index-llms-azure-openai>=0.3.2",
1111
"openinference-instrumentation-llama-index>=4.3.0",
12-
"uipath>=2.0.79, <2.1.0",
12+
"uipath>=2.1.0, <2.2.0",
1313
]
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",

src/uipath_llamaindex/_cli/cli_run.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from dotenv import load_dotenv
77
from uipath._cli._runtime._contracts import UiPathTraceContext
8+
from uipath._cli._utils._common import serialize_object
89
from uipath._cli.middlewares import MiddlewareResult
910

1011
from ._runtime._context import UiPathLlamaIndexRuntimeContext
@@ -17,7 +18,7 @@
1718

1819

1920
def llamaindex_run_middleware(
20-
entrypoint: Optional[str], input: Optional[str], resume: bool
21+
entrypoint: Optional[str], input: Optional[str], resume: bool, **kwargs
2122
) -> MiddlewareResult:
2223
"""Middleware to handle LlamaIndex agent execution"""
2324

@@ -37,6 +38,9 @@ async def execute():
3738
context.entrypoint = entrypoint
3839
context.input = input
3940
context.resume = resume
41+
context.debug = kwargs.get("debug", False)
42+
context.input_file = kwargs.get("input_file", None)
43+
context.execution_output_file = kwargs.get("execution_output_file", None)
4044
context.logs_min_level = env.get("LOG_LEVEL", "INFO")
4145
context.job_id = env.get("UIPATH_JOB_KEY")
4246
context.trace_id = env.get("UIPATH_TRACE_ID")
@@ -57,11 +61,14 @@ async def execute():
5761
env["UIPATH_REQUESTING_FEATURE"] = "llamaindex"
5862

5963
async with UiPathLlamaIndexRuntime.from_context(context) as runtime:
60-
return await runtime.execute()
64+
await runtime.execute()
6165

6266
asyncio.run(execute())
6367

64-
return MiddlewareResult(should_continue=False, error_message=None)
68+
return MiddlewareResult(
69+
should_continue=False,
70+
error_message=None
71+
)
6572

6673
except UiPathLlamaIndexRuntimeError as e:
6774
return MiddlewareResult(

0 commit comments

Comments
 (0)