jina.clients.request package

Module contents

Module for Jina Requests.

jina.clients.request.request_generator(exec_endpoint, data, request_size=0, data_type=<DataInputType.AUTO: 0>, target_peapod=None, parameters=None, **kwargs)[source]

Generate a request iterator.

Parameters
  • exec_endpoint (str) – the endpoint string, by convention starts with /

  • data (Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]]) – data to send, a list of dict/string/bytes that can be converted into a list of Document objects

  • request_size (int) – the number of the Documents in each request

  • data_type (DataInputType) – if data is an iterator over self-contained document, i.e. DocumentSourceType; or an iterator over possible Document content (set to text, blob and buffer).

  • parameters (Optional[Dict]) – a dictionary of parameters to be sent to the executor

  • target_peapod (Optional[str]) – a regex string represent the certain peas/pods request targeted

  • kwargs – additional arguments

Yield

request

Return type

Iterator[Request]