From f6a0c3e97dcf1e11f3411eb4e5336256377c82f5 Mon Sep 17 00:00:00 2001 From: Yuan Tang Date: Tue, 25 Feb 2025 12:17:36 -0500 Subject: [PATCH] fix: Raise exception when tool call result is None Signed-off-by: Yuan Tang --- .../providers/inline/agents/meta_reference/agent_instance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index 560215b25..f83c9aa52 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -804,6 +804,10 @@ class ChatAgent(ShieldRunnerMixin): toolgroup_args, tool_to_group, ) + if tool_result.content is None: + raise ValueError( + f"Tool call result (id: {tool_call.call_id}, name: {tool_call.tool_name}) does not have any content" + ) result_messages = [ ToolResponseMessage( call_id=tool_call.call_id,