jina.clients.base package

Submodules

Module contents

Module containing the Base Client for Jina.

class jina.clients.base.BaseClient(args=None, **kwargs)[source]

Bases: abc.ABC

A base client for connecting to the Flow Gateway.

Parameters
  • args (Optional[Namespace]) – the Namespace from argparse

  • kwargs – additional parameters that can be accepted by client parser

static check_input(inputs=None, **kwargs)[source]

Validate the inputs and print the first request if success.

Parameters
  • inputs (Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], Callable[…, Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]]], None]) – the inputs

  • kwargs – keyword arguments

Return type

None

property inputs: Union[jina.types.document.Document, Iterable[Union[jina.types.document.DocumentContentType, jina.types.document.DocumentSourceType, jina.types.document.Document, Tuple[jina.types.document.DocumentContentType, jina.types.document.DocumentContentType], Tuple[jina.types.document.DocumentSourceType, jina.types.document.DocumentSourceType]]], AsyncIterable[Union[jina.types.document.DocumentContentType, jina.types.document.DocumentSourceType, jina.types.document.Document, Tuple[jina.types.document.DocumentContentType, jina.types.document.DocumentContentType], Tuple[jina.types.document.DocumentSourceType, jina.types.document.DocumentSourceType]]], Callable[[...], Union[jina.types.document.Document, Iterable[Union[jina.types.document.DocumentContentType, jina.types.document.DocumentSourceType, jina.types.document.Document, Tuple[jina.types.document.DocumentContentType, jina.types.document.DocumentContentType], Tuple[jina.types.document.DocumentSourceType, jina.types.document.DocumentSourceType]]], AsyncIterable[Union[jina.types.document.DocumentContentType, jina.types.document.DocumentSourceType, jina.types.document.Document, Tuple[jina.types.document.DocumentContentType, jina.types.document.DocumentContentType], Tuple[jina.types.document.DocumentSourceType, jina.types.document.DocumentSourceType]]]]]]

An iterator of bytes, each element represents a Document’s raw content.

inputs defined in the protobuf

Return type

Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], Callable[…, Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]]]]

Returns

inputs

property client: jina.clients.base.BaseClient

Return the client object itself

Return type

BaseClient

Returns

the Client object