fix: Raise exception when tool call result is None

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2025-02-25 12:17:36 -05:00
parent 1bd080c23d
commit f6a0c3e97d
No known key found for this signature in database

View file

@ -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,