diff --git a/pyproject.toml b/pyproject.toml index c61846b0..e100fd0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-llamaindex" -version = "0.0.15" +version = "0.0.16" description = "UiPath LlamaIndex SDK" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" diff --git a/samples/image-gen-agent/main.py b/samples/image-gen-agent/main.py index e8d77f48..b603cbf7 100644 --- a/samples/image-gen-agent/main.py +++ b/samples/image-gen-agent/main.py @@ -60,9 +60,7 @@ async def generate_image(self, ev: TopicEvent) -> ImageEvent: image_url = image_tool.image_generation(text=topic) # Return the event with the image URL - return ImageEvent( - topic=topic, image_url=image_url, job_key=os.environ.get("UIPATH_JOB_KEY") - ) + return ImageEvent(topic=topic, image_url=image_url) @step async def generate_image_name(self, ev: ImageEvent) -> NamedImageEvent: @@ -125,7 +123,11 @@ async def upload_attachment(self, ev: NamedImageEvent) -> OutputEvent: # Upload to UiPath using async method uipath_client = UiPath() attachment_id = await uipath_client.jobs.create_attachment_async( - name=ev.image_name, source_path=image_path, category="generated_images" + name=ev.image_name, + source_path=image_path, + category="generated_images", + job_key=os.environ.get("UIPATH_JOB_KEY"), + folder_key=os.environ.get("UIPATH_FOLDER_KEY"), ) # Return the final event diff --git a/samples/image-gen-agent/pyproject.toml b/samples/image-gen-agent/pyproject.toml index 81d9ba25..06a11a68 100644 --- a/samples/image-gen-agent/pyproject.toml +++ b/samples/image-gen-agent/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "llama-image-gen-agent" -version = "0.0.1" +version = "0.0.3" description = "UiPath LlamaIndex Image Generation Agent" authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] readme = { file = "README.md", content-type = "text/markdown" } diff --git a/samples/image-gen-agent/uv.lock b/samples/image-gen-agent/uv.lock index 89b18abe..a4cdb036 100644 --- a/samples/image-gen-agent/uv.lock +++ b/samples/image-gen-agent/uv.lock @@ -925,7 +925,7 @@ wheels = [ [[package]] name = "llama-image-gen-agent" -version = "0.0.1" +version = "0.0.2" source = { virtual = "." } dependencies = [ { name = "llama-index-llms-openai" }, diff --git a/samples/simple-hitl-agent/pyproject.toml b/samples/simple-hitl-agent/pyproject.toml index 23416ab9..e7a58f96 100644 --- a/samples/simple-hitl-agent/pyproject.toml +++ b/samples/simple-hitl-agent/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "llama-simple-hitl-agent" -version = "0.0.5" +version = "0.0.6" description = "UiPath LlamaIndex Simple HITL Agent" authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" dependencies = [ - "uipath-llamaindex>=0.0.14", + "uipath-llamaindex>=0.0.15", "llama-index-llms-openai>=0.2.2" ] diff --git a/samples/simple-hitl-agent/uv.lock b/samples/simple-hitl-agent/uv.lock index a3bd9baa..c671fb96 100644 --- a/samples/simple-hitl-agent/uv.lock +++ b/samples/simple-hitl-agent/uv.lock @@ -1123,7 +1123,7 @@ wheels = [ [[package]] name = "llama-simple-hitl-agent" -version = "0.0.2" +version = "0.0.5" source = { virtual = "." } dependencies = [ { name = "llama-index-llms-openai" }, @@ -1133,7 +1133,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "llama-index-llms-openai", specifier = ">=0.2.2" }, - { name = "uipath-llamaindex", specifier = ">=0.0.14" }, + { name = "uipath-llamaindex", specifier = ">=0.0.15" }, ] [[package]] @@ -2605,16 +2605,16 @@ wheels = [ [[package]] name = "uipath-llamaindex" -version = "0.0.14" +version = "0.0.15" source = { registry = "https://pypi.org/simple/" } dependencies = [ { name = "llama-index" }, { name = "openinference-instrumentation-llama-index" }, { name = "uipath" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f9/c6/4d1bb4a02bb156a641e645c6901e05b57c001704cfc30ad397947bd09c31/uipath_llamaindex-0.0.14.tar.gz", hash = "sha256:ae669dc779e0460252e2dc2e7e7ff894bb92eef6a701bbcee6b042ae7dd29371", size = 452192 } +sdist = { url = "https://files.pythonhosted.org/packages/15/a0/9077dde6d0dc366d84ef95c1bb062cef1f7c226fbef1c4614188dd748348/uipath_llamaindex-0.0.15.tar.gz", hash = "sha256:b808788c9e9c5eae4ceae424144d37879dafb8ceff6f241028b19710d93bae65", size = 589818 } wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/b2/474ccb5c0da99701d56088c2fe65c7adabc18d9ac1d1ee2bdf360b5220e2/uipath_llamaindex-0.0.14-py3-none-any.whl", hash = "sha256:ec465e3966f3f877fea003b144eb544032e015f12d64fddd8f8f94ba9c65af79", size = 16533 }, + { url = "https://files.pythonhosted.org/packages/8e/96/75cfc817c4b33d3f29736b1360149ed0f0c9f5a0839116cf89f57b53cd5d/uipath_llamaindex-0.0.15-py3-none-any.whl", hash = "sha256:6fc8856865b7529b1dcd26f25bc0799d695fc6424ccbeced8acb95b12b6248cf", size = 16531 }, ] [[package]] diff --git a/src/uipath_llamaindex/_cli/_runtime/_runtime.py b/src/uipath_llamaindex/_cli/_runtime/_runtime.py index 0cae180c..a683cee7 100644 --- a/src/uipath_llamaindex/_cli/_runtime/_runtime.py +++ b/src/uipath_llamaindex/_cli/_runtime/_runtime.py @@ -98,13 +98,13 @@ async def execute(self) -> Optional[UiPathRuntimeResult]: resume=resume_trigger, ) - if self.context.state_file: + if self.state_file_path: serializer = JsonPickleSerializer() ctx_dict = ctx.to_dict(serializer=serializer) ctx_dict["uipath_resume_trigger"] = ( serializer.serialize(resume_trigger) if resume_trigger else None ) - with open(self.context.state_file, "wb") as f: + with open(self.state_file_path, "wb") as f: pickle.dump(ctx_dict, f) return self.context.result @@ -222,13 +222,13 @@ async def _get_context(self) -> Context: if not self.context.resume: return Context(self.context.workflow) - if not self.context.state_file or not os.path.exists(self.context.state_file): + if not self.state_file_path or not os.path.exists(self.state_file_path): return Context(self.context.workflow) serializer = JsonPickleSerializer() ctx: Context = None - with open(self.context.state_file, "rb") as f: + with open(self.state_file_path, "rb") as f: loaded_ctx_dict = pickle.load(f) ctx = Context.from_dict( self.context.workflow,