Conversation.clear_messages()

Remove all messages from the conversation.

Usage

Source

Conversation.clear_messages()

Resets the message history to an empty state while preserving the conversation ID, metadata, and context window settings.

Examples

from talk_box.conversation import Conversation

convo = Conversation()
convo.add_user_message("Hello")
convo.clear_messages()
convo.get_message_count()
0