Delete History Matching • AI Agent SDK

delete_history_matching: Delete all messages matching a pattern.

delete_history_matching

Method

</div>

This is a method of the Agent class in the agent module.

Delete all messages matching a pattern.

Useful for removing all image-related messages after processing.

Signature

python
def delete_history_matching(pattern: str) -> int

Parameters

ParamField str

Substring to match in message content

Returns

ResponseField int

Number of messages deleted

Source

View on GitHub

praisonaiagents/agent/agent.py at line 4253