Should Retrieve • AI Agent SDK

should_retrieve: Determine if retrieval should be performed for a query.

should_retrieve

Method

</div>

This is a method of the RetrievalConfig class in the retrieval_config module.

Determine if retrieval should be performed for a query.

Signature

python
def should_retrieve(query: str, force: bool, skip: bool) -> bool

Parameters

ParamField str

The user query

ParamField bool

Force retrieval regardless of policy

ParamField bool

Skip retrieval regardless of policy

Returns

ResponseField bool

True if retrieval should be performed

Source

View on GitHub

praisonaiagents/rag/retrieval_config.py at line 335