From fdb11094911b0e01a00dcf38d9b3275b7e5dfff3 Mon Sep 17 00:00:00 2001 From: Michael Clifford Date: Sun, 27 Apr 2025 13:54:44 -0400 Subject: [PATCH] fix: tools page on playground resets agent after every interaction Signed-off-by: Michael Clifford --- llama_stack/distribution/ui/page/playground/tools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/llama_stack/distribution/ui/page/playground/tools.py b/llama_stack/distribution/ui/page/playground/tools.py index 6c6a9fcfd..149d8cce9 100644 --- a/llama_stack/distribution/ui/page/playground/tools.py +++ b/llama_stack/distribution/ui/page/playground/tools.py @@ -94,12 +94,16 @@ def tool_chat_page(): st.subheader("Agent Configurations") st.subheader("Agent Type") agent_type = st.radio( - "Select Agent Type", - [AgentType.REGULAR, AgentType.REACT], - format_func=lambda x: x.value, + label="Select Agent Type", + options=["Regular", "ReAct"], on_change=reset_agent, ) + if agent_type == "ReAct": + agent_type = AgentType.REACT + else: + agent_type = AgentType.REGULAR + max_tokens = st.slider( "Max Tokens", min_value=0,