From 0dbe8ebf07d1171f64e58be41793d165ef64a038 Mon Sep 17 00:00:00 2001 From: Maxwell Du <60411452+maxduu@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:59:25 -0400 Subject: [PATCH 1/2] feat: truncate conversational agent time for increased prompt-caching hits --- .../src/uipath/agent/react/conversational_prompts.py | 7 ++++--- .../tests/agent/react/test_conversational_prompts.py | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/uipath/src/uipath/agent/react/conversational_prompts.py b/packages/uipath/src/uipath/agent/react/conversational_prompts.py index d966dd55b..18ace179f 100644 --- a/packages/uipath/src/uipath/agent/react/conversational_prompts.py +++ b/packages/uipath/src/uipath/agent/react/conversational_prompts.py @@ -22,7 +22,7 @@ class PromptUserSettings(BaseModel): _AGENT_SYSTEM_PROMPT_PREFIX_TEMPLATE = """You are {{CONVERSATIONAL_AGENT_SERVICE_PREFIX_agentName}}. -The current date is: {{CONVERSATIONAL_AGENT_SERVICE_PREFIX_currentDate}}. +Current date and time (UTC, rounded down to the hour): {{CONVERSATIONAL_AGENT_SERVICE_PREFIX_currentDate}} Understand user goals through conversation and use appropriate tools to fulfill requests. ===================================================================== @@ -162,8 +162,9 @@ def get_chat_system_prompt( Returns: The complete system prompt string """ - # Format date as ISO 8601 (yyyy-MM-ddTHH:mmZ) - formatted_date = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%MZ") + # Truncated to the hour to increase prompt-caching hits + now = datetime.now(timezone.utc) + formatted_date = f"{now:%A, %B} {now.day}, {now:%Y}, {now:%H}:00 UTC" prompt = _AGENT_SYSTEM_PROMPT_PREFIX_TEMPLATE prompt = prompt.replace( diff --git a/packages/uipath/tests/agent/react/test_conversational_prompts.py b/packages/uipath/tests/agent/react/test_conversational_prompts.py index 2ddafc904..8e84a2604 100644 --- a/packages/uipath/tests/agent/react/test_conversational_prompts.py +++ b/packages/uipath/tests/agent/react/test_conversational_prompts.py @@ -105,7 +105,7 @@ def test_generate_system_prompt_includes_agent_name(self): assert "You are Customer Support Bot." in prompt def test_generate_system_prompt_includes_current_date(self): - """Current date in ISO 8601 format is included.""" + """Current date is included, truncated to the hour.""" # Mock datetime to have a predictable value mock_dt = datetime(2026, 1, 15, 10, 30, tzinfo=timezone.utc) with patch( @@ -123,7 +123,8 @@ def test_generate_system_prompt_includes_current_date(self): user_settings=None, ) - assert "2026-01-15T10:30Z" in prompt + assert "Thursday, January 15, 2026, 10:00 UTC" in prompt + assert "10:30" not in prompt def test_generate_system_prompt_includes_attachments_section(self): """Attachments template is always included.""" From eb1af285b857346e8c3d2323f01a97df0bfca377 Mon Sep 17 00:00:00 2001 From: Maxwell Du <60411452+maxduu@users.noreply.github.com> Date: Fri, 30 Oct 2026 17:03:42 -0400 Subject: [PATCH 2/2] chore: upgrade version --- packages/uipath/pyproject.toml | 2 +- packages/uipath/uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uipath/pyproject.toml b/packages/uipath/pyproject.toml index bccd2b9df..698b9b82f 100644 --- a/packages/uipath/pyproject.toml +++ b/packages/uipath/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath" -version = "2.14.44" +version = "2.14.45" description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/packages/uipath/uv.lock b/packages/uipath/uv.lock index e6ae1076e..c463c717e 100644 --- a/packages/uipath/uv.lock +++ b/packages/uipath/uv.lock @@ -2599,7 +2599,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.14.44" +version = "2.14.45" source = { editable = "." } dependencies = [ { name = "applicationinsights" },