Hello, I am facing error in getting the last_message from my ConversationalAgent.
When I'm trying to get the last_message, I'm getting an error saying that "Error in fetching answer. Error - "The agent 'assistant' is not present in any conversation. No history available for this agent.".
"
The code snippet is as follows -
`class AutogenAgent(AutogenAgentParams):
def init(self):
AutogenAgentParams.init(self)
self.llm_config = {
"timeout": self.timeout,
"seed": self.seed,
"temperature": self.temperature,
"config_list": self.config_list,
}
self.coding_agent = autogen.AssistantAgent(name="assistant", llm_config=self.llm_config)
self.user_proxy_agent = autogen.UserProxyAgent(
name="user_proxy",
human_input_mode="NEVER",
max_consecutive_auto_reply=10,
llm_config=self.llm_config,
code_execution_config=self.code_exec_config,
system_message="""Reply TERMINATE if the task has been solved with full satisfaction. Otherwise, reply CONTINUE, or the reason why the task is not solved yet.""",
)
def exec(self, task: str):
self.user_proxy_agent.initiate_chat(self.coding_agent, message=task)
last_msgs = self.coding_agent.chat_messages
last_single_msg = self.coding_agent.last_message(self.coding_agent)
print("last message-----", last_msgs)`