Skip to main content

delete_history

Method
This is a method of the Agent class in the agent module.
Delete a specific message from chat history by index. Supports negative indexing (-1 for last message, etc.).

Signature

def delete_history(index: int) -> bool

Parameters

index
int
required
Message index (0-based, supports negative indexing)

Returns

Returns
bool
True if deleted, False if index out of range