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
def check_and_add(content_hash: str, agent_name: str, tokens: int) -> boolParameters
ParamField
strHash of the content
ParamField
strName of the agent adding this content
ParamField
intEstimated tokens in this content
Returns
ResponseField
boolTrue if duplicate (already exists), False if new
Source
View on GitHubpraisonaiagents/context/manager.py at line 59