Skip to content

Search

search

Shared TypedDict shapes for search tool result entries.

These types describe serialized symbol dicts and suggestion dicts produced by ast_search, lifted out of tools/search.py so that tools/ search_text.py can consume them without an explicit Any.

SearchFilters

Bases: TypedDict

Filter snapshot passed to text renderers.

Source code in packages/axm-ast/src/axm_ast/core/search.py
Python
class SearchFilters(TypedDict):
    """Filter snapshot passed to text renderers."""

    name: str | None
    returns: str | None
    kind: SymbolKind | None
    inherits: str | None

SearchResultEntry

Bases: TypedDict

Serialized symbol dict produced by SearchTool._format_symbol.

name and module are always present; the remaining keys are populated based on the symbol kind.

Source code in packages/axm-ast/src/axm_ast/core/search.py
Python
class SearchResultEntry(TypedDict, total=False):
    """Serialized symbol dict produced by ``SearchTool._format_symbol``.

    ``name`` and ``module`` are always present; the remaining keys are
    populated based on the symbol kind.
    """

    name: str
    module: str
    signature: str | None
    return_type: str | None
    kind: str
    annotation: str
    value_repr: str

Suggestion

Bases: TypedDict

Fuzzy-match suggestion for an unknown symbol query.

Source code in packages/axm-ast/src/axm_ast/core/search.py
Python
class Suggestion(TypedDict):
    """Fuzzy-match suggestion for an unknown symbol query."""

    name: str
    score: float
    kind: str
    module: str