aito.client.v2.responses.V2RowsResponse
- class aito.client.v2.responses.V2RowsResponse(json: Dict)
Bases:
V2ResponseA
rowsresponse — a page of hitsThe shape returned by
_query,_search,_predict,_recommend,_relateand_match. It stays bare ({offset, total, hits}) in v2 for v1 compatibility.- Parameters:
json (Dict) – the parsed JSON response
Methods
Attributes
which engine answered, if the client requested
metathe first hit, or
Nonewhen nothing matchedthe returned hits
the raw JSON response
the result kind this response class represents
the response metadata, empty unless the client was built with
meta=Truethe number of hits skipped
the total number of matching rows, which may exceed
len(hits)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
Nonewhen nothing matchedA predict, recommend or match response is ranked, so this is the top result. Returns
Nonerather than raising because an empty result is an ordinary outcome, not an error.- Return type:
Optional[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=TrueCurrently carries
engine—v2for a collection served by the rep2 engine,v1for 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
whereit could not apply here rather than failing the request.- Return type:
List[V2Warning]