Find answers from the community

Updated 2 months ago

devs, i need to feed a system prompt to

devs, i need to feed a system prompt to my ReAct agent, do i use it like in the.
ReAct Agent - A Simple Intro with Calculator Tools
agent.update_prompts({"agent_worker:system_prompt": react_system_prompt}) ?
W
L
2 comments
I think updating this should work:

Plain Text
from llama_index.core.agent import ReActAgent
agent = ReActAgent.from_tools(react_chat_formatter="UPDATE THIS")

https://github.com/run-llama/llama_index/blob/802064aee72b03ab38ead0cda780cfa3e37ce728/llama-index-core/llama_index/core/agent/react/base.py#L100
Yea, both of those should work. You need to update the (quite large) system prompt that is explaining how the react format works

One easier option is providing the context parameter, which gets inserted into the existing react prompt

ReActAgent.from_tools(..., context="<context about the agents task or job>")
Add a reply
Sign up and join the conversation on Discord