jina.types.request.data module

    Bases: jina.types.request.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

        Returns

        True if the proto was deserialized before

    • property proto: jina_pb2.DataRequestProto

      Cast self to a jina_pb2.DataRequestProto. Laziness will be broken and serialization will be recomputed when calling SerializeToString(). :rtype: :return: protobuf instance

    • to_dict()

      Return the object in Python dictionary.

      Note

    • property docs: docarray.array.document.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: :return: a Python dict view of the parameters.

    • property status

      Returns the status from the header field

      • Returns

        the status object of this request

    • classmethod from_proto(request)[source]

      Creates a new DataRequest object from a given DataRequestProto object. :type request: DataRequestProto :param request: the to-be-copied data request :return: the new message object

    class jina.types.request.data.Response(request=None)

    Bases: jina.types.request.data.DataRequest

    Response is the Request object returns from the flow. Right now it shares the same representation as . At 0.8.12, is a simple alias. But it does give a more consistent semantic on the client API: send a Request and receive a Response.

    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.