ambitious-dusk-46857
06/25/2025, 10:31 AMtall-airline-16756
06/25/2025, 10:31 AMtall-airline-16756
06/25/2025, 10:31 AMtruncate
method in the ChatContext class is designed to update the actual ChatContext object. It modifies the internal _items
list in place using the line self._items[:] = new_items
, ensuring that the context is updated with the truncated version. If you're still encountering issues where old chats appear in the ChatContext, it might be worth checking if the method is being called correctly or if there are other parts of the code reinitializing or overriding the ChatContext.
Sources: GitHub::livekit::agents | livekit-agents/livekit/agents/llm/chat_context.py