hi! I am saving the messages at the database so if we have to upgrade production, we can get the back. The problem is that I can't configure them in the new agent: From this code:
print("chat send", chat_history)
self._agent = OpenAIAgent.from_tools(
_all_tools,
llm=llm,
callback_manager=callback_manager,
memory=_memory,
system_prompt=TEXT_QA_SYSTEM_PROMPT.content,
chat_history=chat_history,
)
print("chat history", self._agent.chat_history)
I get:
chat send [ChatMessage(role=<MessageRole.USER: 'user'>, content='elmatero', additional_kwargs={}), ChatMessage(role=<MessageRole.ASSISTANT: 'assistant'>, content='Buenos días, mi nombre es Juan Pablo. ¿En qué lo puedo ayudar?', additional_kwargs={}), ChatMessage(role=<MessageRole.USER: 'user'>, content='elmatero', additional_kwargs={}), ChatMessage(role=<MessageRole.ASSISTANT: 'assistant'>, content='Buenos días, mi nombre es Juan Pablo. ¿En qué lo puedo ayudar?', additional_kwargs={})]
chat history []
And the format I am passing the agent is the same I get from: self._agent.chat_history