From e9ee8eb812f240ddc8d177423504199689b881c5 Mon Sep 17 00:00:00 2001 From: Michael Clifford Date: Fri, 18 Apr 2025 15:10:03 -0400 Subject: [PATCH] feat: add tool name to chat output Signed-off-by: Michael Clifford --- llama_stack/distribution/ui/page/playground/tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llama_stack/distribution/ui/page/playground/tools.py b/llama_stack/distribution/ui/page/playground/tools.py index fac6ef52a..cd414723d 100644 --- a/llama_stack/distribution/ui/page/playground/tools.py +++ b/llama_stack/distribution/ui/page/playground/tools.py @@ -133,7 +133,11 @@ def tool_chat_page(): yield response.event.payload.delta.text if response.event.payload.event_type == "step_complete": if response.event.payload.step_details.step_type == "tool_execution": - yield " šŸ›  " + if response.event.payload.step_details.tool_calls: + tool_name = str(response.event.payload.step_details.tool_calls[0].tool_name) + yield f'\n\nšŸ›  :grey[_Using "{tool_name}" tool:_]\n\n' + else: + yield "No tool_calls present in step_details" else: yield f"Error occurred in the Llama Stack Cluster: {response}"