Skip to content

Commit b5dce10

Browse files
authored
refactor: update react_agent to use tool_config (#139)
# What does this PR do? - update react agent to use tool_config + system prompt override [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan ``` python -m examples.agents.react_agent ``` <img width="842" alt="image" src="https://github.com/user-attachments/assets/2bc2d2e8-a820-460b-b680-27e4b0e1f88b" /> [//]: # (## Documentation) [//]: # (- [ ] Added a Changelog entry if the change is significant)
1 parent 930138a commit b5dce10

File tree

1 file changed

+5
-3
lines changed
  • src/llama_stack_client/lib/agents/react

1 file changed

+5
-3
lines changed

src/llama_stack_client/lib/agents/react/agent.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ def get_tool_defs():
8383
instructions=instruction,
8484
toolgroups=builtin_toolgroups,
8585
client_tools=[client_tool.get_tool_definition() for client_tool in client_tools],
86-
tool_choice="auto",
87-
# TODO: refactor this to use SystemMessageBehaviour.replace
88-
tool_prompt_format="json",
86+
tool_config={
87+
"tool_choice": "auto",
88+
"tool_prompt_format": "json" if "3.1" in model else "python_list",
89+
"system_message_behavior": "replace",
90+
},
8991
input_shields=[],
9092
output_shields=[],
9193
enable_session_persistence=False,

0 commit comments

Comments
 (0)