Skip to main content

check_and_add

Method
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) -> bool

Parameters

content_hash
str
required
Hash of the content
agent_name
str
required
Name of the agent adding this content
tokens
int
default:"0"
Estimated tokens in this content

Returns

Returns
bool
True if duplicate (already exists), False if new