jina.clients.base

class jina.clients.base.BaseClient(args)[source]

Bases: object

A base client for connecting to the gateway.

Note

BaseClient does not provide train, index, search interfaces. Please use Client or AsyncClient.

Parameters

args (Namespace) – args provided by the CLI

property mode
Return type

str

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

Validate the input_fn and print the first request if success

Parameters

input_fn (Union[Iterator[Union[~DocumentContentType, ~DocumentSourceType, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], Callable[…, Iterator[Union[~DocumentContentType, ~DocumentSourceType, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]], None]) – the input function

Return type

None

property input_fn

An iterator of bytes, each element represents a document’s raw content, i.e. input_fn defined in the protobuf

Return type

Union[Iterator[Union[~DocumentContentType, ~DocumentSourceType, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], Callable[…, Iterator[Union[~DocumentContentType, ~DocumentSourceType, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]]]

index()[source]
search()[source]
train()[source]