Delete History • AI Agent SDK

delete_history: Delete a specific message from chat history by index.

delete_history

Method

</div>

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

python
def delete_history(index: int) -> bool

Parameters

ParamField int

Message index (0-based, supports negative indexing)

Returns

ResponseField bool

True if deleted, False if index out of range

Source

View on GitHub

praisonaiagents/agent/agent.py at line 4234