aito.client.v2.responses.V2RowsResponse

class aito.client.v2.responses.V2RowsResponse(json: Dict)

Bases: V2Response

A rows response — a page of hits

The shape returned by _query, _search, _predict, _recommend, _relate and _match. It stays bare ({offset, total, hits}) in v2 for v1 compatibility.

Parameters:

json (Dict) – the parsed JSON response

Methods

Attributes

engine

which engine answered, if the client requested meta

first

the first hit, or None when nothing matched

hits

the returned hits

json

the raw JSON response

kind

the result kind this response class represents

meta

the response metadata, empty unless the client was built with meta=True

offset

the number of hits skipped

total

the total number of matching rows, which may exceed len(hits)

warnings

the non-fatal notes the engine attached to this response

property engine: str | None

which engine answered, if the client requested meta

Return type:

Optional[str]

property first: V2Hit | None

the first hit, or None when nothing matched

A predict, recommend or match response is ranked, so this is the top result. Returns None rather than raising because an empty result is an ordinary outcome, not an error.

Return type:

Optional[V2Hit]

property hits: List[V2Hit]

the returned hits

Return type:

List[V2Hit]

property json: Dict

the raw JSON response

Return type:

Dict

kind: str = 'rows'

the result kind this response class represents

property meta: Dict

the response metadata, empty unless the client was built with meta=True

Currently carries enginev2 for a collection served by the rep2 engine, v1 for a legacy table served by the compatibility shim.

Return type:

Dict

property offset: int

the number of hits skipped

Return type:

int

property total: int

the total number of matching rows, which may exceed len(hits)

Return type:

int

property warnings: List[V2Warning]

the non-fatal notes the engine attached to this response

Empty for the great majority of responses. Worth checking when a result is unexpectedly broad or unexpectedly empty — the engine reports a where it could not apply here rather than failing the request.

Return type:

List[V2Warning]