Skip to content

[Bug]: Updating ReActAgent's system_prompt does not function correctly #20416

@AkshitGulyan

Description

@AkshitGulyan

Bug Description

Hi,
If I run my agent without updating the System Prompt It functions as required but as soon as I update its system prompt, it stops functioning at all. I mean it does not even make API calls to the LLM.

I am using the exact system prompt as default, but I just added some little instructions in the prompt.

Version

0.12.30

Steps to Reproduce

Client Side Code (ReActAgent initialization):
agent = ReActAgent(
name="SQLAssistant",
llm=llm,
tools=all_tools,
memory=memory,
system_prompt=sysprompt_multi,
description="SQL database query assistant with natural language understanding",
verbose=True,
max_iterations=15,
)

tool_names = [f"{tool.metadata.name}" for tool in all_tools]
react_system_header_str = sysprompt_multi.format(tool_desc=tool_names, tool_names=tool_names)
react_system_prompt = PromptTemplate(react_system_header_str)
agent.update_prompts({"react_header": react_system_prompt})
print("AFTER UPDATION!!!!!!!!!!!!!!!!")
prompts_dict = agent.get_prompts()
display_prompt_dict(prompts_dict)

**It is showing the system prompt as the same which I updated but not answering the queries.

Relevant Logs/Tracbacks

This is the response when the system prompt is not updated:
You: Hello

Assistant: INFO:__main__:Sending prompt for streaming to <LLM Name>: system: You are designed to help with a variety of tasks, from answering questions to providing summ...

=======================================
INFO:__main__:Received streaming response from custom API: Thought: The user greeted me in English. I can answer without using any more tools.
Answer: Hello! H...
Thought: The user greeted me in English. I can answer without using any more tools.
Answer: Hello! How can I assist you today?



This is the response in my CLI when system prompt is updated:

You: Hello

Assistant:

You:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs to be triaged/prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions