ApiIndex#

class ansys.fluent.mcp.solve.catalog.index.ApiIndex(*, custom_path: str | None = None, sessions: Iterable[str] = ('solver_session',), help_map: dict[str, str] | None = None)#

Lightweight searchable index over PyFluent’s api_objects.json.

Thread-safe lazy load. Subclass / replace via custom_path for tests.

Overview#

lookup

Return the exact lookup.

children_of

Return immediate children of path.

search

Token-overlap scoring against the API path tokens.

available

Return whether the catalog index is available.

Import detail#

from ansys.fluent.mcp.solve.catalog.index import ApiIndex

Property detail#

property ApiIndex.available: bool#

Return whether the catalog index is available.

Returns:
bool

Boolean result of the operation.

Method detail#

ApiIndex.lookup(path: str) ApiEntry | None#

Return the exact lookup.

path is the dotted path without the session prefix and without [""] instance keys.

Parameters:
pathstr

Fluent object path or file-system path to inspect.

Returns:
Optional[ApiEntry]

Result produced by the function.

ApiIndex.children_of(path: str, *, max_results: int = 50) list[ApiEntry]#

Return immediate children of path.

This refers to entries whose path begins with path. and has no further dots.

Parameters:
pathstr

Fluent object path or file-system path to inspect.

max_resultsint

Max results to supply to the function.

Returns:
list[ApiEntry]

Collection containing the operation results.

ApiIndex.search(query: str, *, top_k: int = 10, kinds: Iterable[str] | None = None, under: str | None = None) list[ApiSearchHit]#

Token-overlap scoring against the API path tokens.

Parameters:
query

User question or property hint (e.g. "temperature inlet").

top_k

Maximum number of hits to return.

kinds

Optional set of kinds to keep ("Parameter", "Command" …).

under

Optional path prefix; restricts the search to entries below it.

Returns:
list[ApiSearchHit]

Collection containing the operation results.