PyAEDTApiIndex#

class ansys.aedt.mcp.api_search.PyAEDTApiIndex(package_root: pathlib.Path | None = None)#

Lazily built, thread-safe BM25 index over the installed PyAEDT sources.

Overview#

ensure_loaded

Build the index on first use.

subclasses_of

Return public descendants of a class, concrete (leaf) classes first.

search

Rank entries for a free-text, PyAEDT-name, or native-API query.

describe

Serialize an entry for the tool response.

Import detail#

from ansys.aedt.mcp.api_search import PyAEDTApiIndex

Attribute detail#

PyAEDTApiIndex.k1 = 1.4#
PyAEDTApiIndex.b = 0.6#
PyAEDTApiIndex.entries: list[ApiEntry] = []#
PyAEDTApiIndex.version: str | None = None#
PyAEDTApiIndex.parse_errors: list[str] = []#

Method detail#

PyAEDTApiIndex.ensure_loaded() → None#

Build the index on first use.

PyAEDTApiIndex.subclasses_of(class_name: str, limit: int = 8) → list[str]#

Return public descendants of a class, concrete (leaf) classes first.

PyAEDTApiIndex.search(query: str, *, top_k: int = 5, scope: SearchScope = 'all', kinds: Iterable[str] | None = None, module: str | None = None) → list[tuple[ApiEntry, float]]#

Rank entries for a free-text, PyAEDT-name, or native-API query.

PyAEDTApiIndex.describe(entry: ApiEntry, score: float, include_doc: bool = False) → dict#

Serialize an entry for the tool response.