jina.types.request.data module#
- class jina.types.request.data.DataRequest(request=None)[source]#
Bases:
Request
Represents a DataRequest used for exchanging DocumentArrays to and within a Flow
- property is_decompressed: bool#
Checks if the underlying proto object was already deserialized
- Return type
bool
- Returns
True if the proto was deserialized before
- property proto: DataRequestProto#
Cast
self
to ajina_pb2.DataRequestProto
. Laziness will be broken and serialization will be recomputed when callingSerializeToString()
. :rtype:DataRequestProto
:return: protobuf instance
- to_dict()[source]#
Return the object in Python dictionary.
Note
Array like object such as
numpy.ndarray
(i.e. anything described asjina_pb2.NdArrayProto
) will be converted to Python list.- Return type
Dict
- Returns
dict representation of the object
- property docs: DocumentArray#
Get the :class: DocumentArray with sequence data.docs as content.
- Return type
- data#
The decorator to cache property of a class.
- property parameters: Dict#
Return the parameters field of this DataRequest as a Python dict :rtype:
Dict
:return: a Python dict view of the parameters.
- property response#
Returns the response of this request.
- Returns
the response of this request (self) as an instance of Response
- property status#
Returns the status from the header field
- Returns
the status object of this request
- property request_id#
Returns the request_id from the header field
- Returns
the request_id object of this request
- class jina.types.request.data.Response(request=None)[source]#
Bases:
DataRequest
Response is the
Request
object returns from the flow. Right now it shares the same representation asRequest
. At 0.8.12,Response
is a simple alias. But it does give a more consistent semantic on the client API: send aRequest
and receive aResponse
.Note
For now it only exposes Docs and GroundTruth. Users should very rarely access Control commands, so preferably not confuse the user by adding CommandMixin.