#Need help in last message retrieval

4 messages · Page 1 of 1 (latest)

polar hull
#

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)`
austere cape
#

You might be able to get that directly from the returned chat result of initiate_chat now.
cc @marsh perch <@&1205920054621904906>

marsh perch
regal sphinx
#

what is a good semantic chunking library i can use for autogen? i'm looking to chunk and vectorize javascript files