delete_message

Delete a message

client.chat.new_chat('HISTORY_ID', 'UUIDS_TO_DELETE')
from characterai import PyCAI

client = PyCAI('TOKEN')
    
uuids_to_delete = []

history = client.chat.get_history('HISTORY_ID')

uuids_to_delete.append(history['messages'][-1]['uuid'])
uuids_to_delete.append(history['messages'][-2]['uuid'])

client.chat.delete_message('HISTORY_ID', uuids_to_delete)

history_id [str]

Unique ID for character history

uuids_to_delete [list]

List of message IDs that you want to delete, you can delete 1 message, but the line must be in the list

token [str] (optional)

You can set a specific token for the function, it will be executed from the specified token

Last updated