Skip to content

Commit a39cee7

Browse files
fix: analyze file tool validations (#421)
1 parent c98cf8b commit a39cee7

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.4.6"
3+
version = "0.4.7"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath>=2.5.5, <2.6.0",
8+
"uipath>=2.5.6, <2.6.0",
99
"uipath-runtime>=0.5.0,<0.6.0",
1010
"langgraph>=1.0.0, <2.0.0",
1111
"langchain-core>=1.2.5, <2.0.0",

src/uipath_langchain/agent/tools/internal_tools/analyze_files_tool.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,16 @@ async def tool_fn(**kwargs: Any):
5252
if "attachments" not in kwargs:
5353
raise ValueError("Argument 'attachments' is not available")
5454

55-
attachments = kwargs["attachments"]
5655
analysisTask = kwargs["analysisTask"]
56+
if not analysisTask:
57+
raise ValueError("Argument 'analysisTask' is not available")
58+
59+
attachments = kwargs["attachments"]
5760

5861
files = await _resolve_job_attachment_arguments(attachments)
62+
if not files:
63+
return {"analysisResult": "No attachments provided to analyze."}
64+
5965
messages: list[AnyMessage] = [
6066
SystemMessage(content=ANALYZE_FILES_SYSTEM_MESSAGE),
6167
HumanMessage(content=analysisTask),

uv.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)