mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 13:00:39 +00:00
fix(agent): Raise exception when tool call has empty name
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
abfc4b3bce
commit
73771a43da
1 changed files with 2 additions and 0 deletions
|
@ -1077,6 +1077,8 @@ async def execute_tool_call_maybe(
|
|||
tool_to_group: Dict[str, str],
|
||||
) -> ToolInvocationResult:
|
||||
name = tool_call.tool_name
|
||||
if not name:
|
||||
raise ValueError("Tool call has an empty name. Tool call may not have been invoked.")
|
||||
group_name = tool_to_group.get(name, None)
|
||||
if group_name is None:
|
||||
raise ValueError(f"Tool {name} not found in any tool group")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue