![](https://i0.wp.com/media.dev.to/cdn-cgi/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5azag64op4odesi79c58.png?w=1320&ssl=1)
Getting this error while using chat_history for agent chat in Llama Index. Need a quick resolution. Any help on this? You can get the code below-
”’chat_history.append(ChatMessage(role= MessageRole.USER, content=user_message))
response = agent.chat(message=user_message, chat_history= chat_history)
chat_history.append(ChatMessage(role= MessageRole.ASSISTANT, content=response))”’
It is working fine for the 1st time query and giving the error from 2nd one.
Discover more from Coursity
Subscribe to get the latest posts sent to your email.