Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 6 additions & 4 deletions samples/image-gen-agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/image-gen-agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion samples/image-gen-agent/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions samples/simple-hitl-agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
]
10 changes: 5 additions & 5 deletions samples/simple-hitl-agent/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/uipath_llamaindex/_cli/_runtime/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down