Skip to content

Commit fa3d77e

Browse files
committed
feat: fetch automation ops deployed policy in analyze-files tool
1 parent dca81eb commit fa3d77e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import mimetypes
23
import uuid
34
from typing import Any, cast
@@ -38,6 +39,8 @@
3839
extract_text_content,
3940
)
4041

42+
logger = logging.getLogger("uipath")
43+
4144
ANALYZE_FILES_SYSTEM_MESSAGE = (
4245
"Process the provided files to complete the given task. "
4346
"Analyze the files contents thoroughly to deliver an accurate response "
@@ -81,6 +84,13 @@ async def tool_fn(**kwargs: Any):
8184
if not files:
8285
return {"analysisResult": "No attachments provided to analyze."}
8386

87+
try:
88+
client = UiPath()
89+
deployed_policy = await client.automation_ops.get_deployed_policy_async()
90+
logger.info("AutomationOps deployed policy response: %s", deployed_policy)
91+
except Exception:
92+
logger.exception("Failed to fetch AutomationOps deployed policy")
93+
8494
try:
8595
human_message = HumanMessage(content=analysis_task)
8696
human_message_with_files = await add_files_to_message(human_message, files)

0 commit comments

Comments
 (0)