The retriever.py module#

Summary#

ApiHit

One ranked candidate returned by a retriever.

ApiRetriever

ABC for an API retriever. Async by convention.

LexicalApiRetriever

Thin async adapter over ApiIndex.search.

get_default_api_retriever

Return the default API retriever.

set_default_api_retriever

Test/integration hook to override the default.

Description#

API retrieval (RAG over the Fluent API catalog).

Only the lexical retriever is supported.

LexicalApiRetriever is a thin async adapter over ApiIndex, which scores the bundled api_objects.json plus PyFluent class docstrings using BM25. All ranking lives in ansys.fluent.mcp.common.api_index.

Module detail#

retriever.get_default_api_retriever() ApiRetriever#

Return the default API retriever.

Returns:
ApiRetriever

API retriever produced by the operation.

retriever.set_default_api_retriever(retriever: ApiRetriever | None) None#

Test/integration hook to override the default.

Parameters:
retrieverOptional[ApiRetriever]

Retriever to supply to the function.

Returns:
None

The function completes through its side effects.