----------------------
From your code, it seems like you're setting the
system_prompt
while initializing the
FunctionCallingAgentWorker
. However, the
system_prompt
is not a prompt template that can be retrieved using
get_prompts()
. It's a string that's used internally by the agent worker.
The
get_prompts()
method is used to retrieve prompt templates that have been set using the
update_prompts()
method. These are usually used for customizing the prompts that the agent uses during its operation.
If you want to retrieve the
system_prompt
that you set, you can access it directly from the agent worker:
print(agent_worker.system_prompt)
If you want to set and retrieve a prompt template, you can do it like this:
from llama_py import PromptTemplate
# Create a prompt template
prompt_template = PromptTemplate("Your prompt template here")
# Update the agent's prompts
retrieve_agent.update_prompts({"agent_worker:system_prompt": prompt_template})
# Now you can retrieve the prompt
prompt_dict = retrieve_agent.get_prompts()
for k, v in prompt_dict.items():
print(f"Prompt: {k}\n\nValue: {v.template}")
Please replace
"Your prompt template here"
with the actual prompt template you want to use. The key
"agent_worker:system_prompt"
is just an example, you should replace it with the actual key for the prompt you want to set.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------