From d325cc07deed6353d3a9e869fdfe9f3ad0448477 Mon Sep 17 00:00:00 2001 From: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:15:13 -0400 Subject: [PATCH] Update Tool Execution Final Message and Dependencies (#175) * Update final message when max iteration hits in durable agent Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> * Update dependencies Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> * Fix lint Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> * Update testenv deps to include vectorstore Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> --------- Signed-off-by: Roberto Rodriguez <9653181+Cyb3rWard0g@users.noreply.github.com> --- dapr_agents/agents/durableagent/agent.py | 4 ++++ pyproject.toml | 3 --- tox.ini | 2 +- uv.lock | 8 ++------ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dapr_agents/agents/durableagent/agent.py b/dapr_agents/agents/durableagent/agent.py index 4036518..aae79bd 100644 --- a/dapr_agents/agents/durableagent/agent.py +++ b/dapr_agents/agents/durableagent/agent.py @@ -209,6 +209,8 @@ class DurableAgent(AgenticWorkflow, AgentBase): # šŸ”“ If this was the last turn, stop here—even though there were tool calls if turn == self.max_iterations: final_message = response_message + # Make sure content exists and is a string + final_message["content"] = final_message.get("content") or "" final_message[ "content" ] += "\n\nāš ļø Stopped: reached max iterations." @@ -223,6 +225,8 @@ class DurableAgent(AgenticWorkflow, AgentBase): # šŸ”“ If it happened to be the last turn, banner it if turn == self.max_iterations: + # Again, ensure content is never None + final_message["content"] = final_message.get("content") or "" final_message["content"] += "\n\nāš ļø Stopped: reached max iterations." break # exit loop with final_message diff --git a/pyproject.toml b/pyproject.toml index 2c3d4b9..bedc068 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,9 +37,6 @@ dependencies = [ "numpy>=2.2.2,<3.0.0", "mcp>=1.7.1,<2.0.0", "pip-tools>=7.4.1,<8.0.0", - "sentence-transformers>=4.1.0,<5.0.0", - "chromadb>=1.0.13,<2.0.0", - "posthog<6.0.0", ] classifiers = [ "Development Status :: 2 - Pre-Alpha", diff --git a/tox.ini b/tox.ini index 9a6f14a..03668ac 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = [testenv] deps = - -e .[test] + -e .[test,vectorstore] numpy durabletask cloudevents diff --git a/uv.lock b/uv.lock index fc39558..9f4002c 100644 --- a/uv.lock +++ b/uv.lock @@ -664,7 +664,6 @@ source = { editable = "." } dependencies = [ { name = "aiohttp" }, { name = "azure-identity" }, - { name = "chromadb" }, { name = "cloudevents" }, { name = "colorama" }, { name = "dapr" }, @@ -681,13 +680,11 @@ dependencies = [ { name = "openapi-pydantic" }, { name = "openapi-schema-pydantic" }, { name = "pip-tools" }, - { name = "posthog" }, { name = "pydantic" }, { name = "pyyaml" }, { name = "regex" }, { name = "requests" }, { name = "rich" }, - { name = "sentence-transformers" }, { name = "uvicorn" }, ] @@ -715,13 +712,13 @@ vectorstore = [ { name = "chromadb" }, { name = "posthog" }, { name = "sentence-transformers" }, + { name = "torch" }, ] [package.metadata] requires-dist = [ { name = "aiohttp", specifier = ">=3.9.0,<4.0.0" }, { name = "azure-identity", specifier = ">=1.21.0,<2.0.0" }, - { name = "chromadb", specifier = ">=1.0.13,<2.0.0" }, { name = "chromadb", marker = "extra == 'vectorstore'", specifier = ">=0.4.22,<2.0.0" }, { name = "cloudevents", specifier = ">=1.11.0,<2.0.0" }, { name = "colorama", specifier = ">=0.4.6,<1.0.0" }, @@ -745,7 +742,6 @@ requires-dist = [ { name = "opentelemetry-exporter-otlp", marker = "extra == 'observability'", specifier = ">=1.32.1,<1.35.0" }, { name = "opentelemetry-instrumentation-requests", marker = "extra == 'observability'", specifier = ">=0.53b1,<0.56b0" }, { name = "pip-tools", specifier = ">=7.4.1,<8.0.0" }, - { name = "posthog", specifier = "<6.0.0" }, { name = "posthog", marker = "extra == 'vectorstore'", specifier = "<6.0.0" }, { name = "pydantic", specifier = ">=2.11.3,<3.0.0" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=7.0.0,<8.0.0" }, @@ -756,8 +752,8 @@ requires-dist = [ { name = "regex", specifier = ">=2023.0.0,<2025.0.0" }, { name = "requests", specifier = ">=2.31.0,<3.0.0" }, { name = "rich", specifier = ">=13.9.4,<14.0.0" }, - { name = "sentence-transformers", specifier = ">=4.1.0,<5.0.0" }, { name = "sentence-transformers", marker = "extra == 'vectorstore'", specifier = ">=4.1.0,<5.0.0" }, + { name = "torch", marker = "extra == 'vectorstore'", specifier = ">=2.7.0" }, { name = "tox", marker = "extra == 'dev'", specifier = ">=4.0.0,<5.0.0" }, { name = "uvicorn", specifier = ">=0.27.0,<1.0.0" }, { name = "wrapt", marker = "extra == 'observability'", specifier = ">=1.14.0,<2.0.0" },