Check And Add • AI Agent SDK

check_and_add: Check if content hash exists and add if new.

check_and_add

Method

</div>

This is a method of the SessionDeduplicationCache class in the manager module.

Check if content hash exists and add if new.

Signature

python
def check_and_add(content_hash: str, agent_name: str, tokens: int) -> bool

Parameters

ParamField str

Hash of the content

ParamField str

Name of the agent adding this content

ParamField int

Estimated tokens in this content

Returns

ResponseField bool

True if duplicate (already exists), False if new

Source

View on GitHub

praisonaiagents/context/manager.py at line 59