----------------------
To add a system prompt to an instance of
ReActAgentWorker
, you can follow these steps:
- First, you need to create a
PromptTemplate
with your desired system prompt string. The PromptTemplate
class is part of the llama_index.core
module. Here is an example of how to create a PromptTemplate
:
from llama_index.core import PromptTemplate
react_system_header_str = "Your desired system prompt here"
react_system_prompt = PromptTemplate(react_system_header_str)
Source ()
- Once you have your
PromptTemplate
, you can use the update_prompts
method of the ReActAgentWorker
instance to add your system prompt. Here is an example:
agent.update_prompts({"agent_worker:system_prompt": react_system_prompt})
Source ()
Please note that the
update_prompts
method updates the prompts of the
ReActAgentWorker
instance. If you want to check the current prompts, you can use the
get_prompts
method:
Source ()
Remember to replace
agent
with your instance of
ReActAgentWorker
.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------