jina.clients.request

Module for Jina Requests.

jina.clients.request.request_generator(data, request_size=0, mode=<RequestType.INDEX: 0>, mime_type=None, queryset=None, data_type=<DataInputType.AUTO: 0>, **kwargs)[source]

Generate a request iterator.

Parameters
  • 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]]]]) – the data to use in the request

  • request_size (int) – the request size for the client

  • mode (RequestType) – the request mode (index, search etc.)

  • mime_type (Optional[str]) – mime type

  • queryset (Union[QueryLang, QueryLangProto, Dict, Iterator[Union[QueryLang, QueryLangProto, Dict]], None]) – querylang set of queries

  • 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).

  • kwargs – additional arguments

Yield

request

Return type

Iterator[Request]