jina.peapods.runtimes.gateway.http.models module

class jina.peapods.runtimes.gateway.http.models.CustomConfig[source]

Bases: pydantic.main.BaseConfig

Pydantic config for Camel case and enum handling

use_enum_values = True
allow_population_by_field_name = True
fields = {'envelope': {'alias': 'envelope', 'alias_priority': 2}, 'request': {'alias': 'request', 'alias_priority': 2}}
jina.peapods.runtimes.gateway.http.models.protobuf_to_pydantic_model(protobuf_model)[source]

Converts Protobuf messages to Pydantic model for jsonschema creation/validattion

..note:: Model gets assigned in the global Namespace :data:PROTO_TO_PYDANTIC_MODELS

Parameters

protobuf_model (Union[Descriptor, GeneratedProtocolMessageType]) – message from jina.proto file

Return type

BaseModel

Returns

Pydantic model

class jina.peapods.runtimes.gateway.http.models.JinaStatusModel(**data)[source]

Bases: pydantic.main.BaseModel

Pydantic BaseModel for Jina status, used as the response model in REST app.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

jina: Dict
envs: Dict
used_memory: str
class Config[source]

Bases: object

alias_generator()
Return type

str

allow_population_by_field_name = True
class jina.peapods.runtimes.gateway.http.models.JinaRequestModel(**data)[source]

Bases: pydantic.main.BaseModel

Jina HTTP request model.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

data: Optional[Union[List[pydantic.main.DocumentProto], List[Dict[str, Any]], List[str], List[bytes]]]
target_peapod: Optional[str]
parameters: Optional[Dict]
class Config[source]

Bases: object

alias_generator()
Return type

str

allow_population_by_field_name = True
class jina.peapods.runtimes.gateway.http.models.JinaResponseModel(**data)[source]

Bases: pydantic.main.BaseModel

Jina HTTP Response model. Only request_id and data are preserved.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

class DataRequestModel(**data)[source]

Bases: pydantic.main.BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

docs: Optional[List[Dict[str, Any]]]
groundtruths: Optional[List[Dict[str, Any]]]
request_id: str
data: Optional[jina.peapods.runtimes.gateway.http.models.JinaResponseModel.DataRequestModel]
class Config[source]

Bases: object

alias_generator()
Return type

str

allow_population_by_field_name = True
class jina.peapods.runtimes.gateway.http.models.JinaEndpointRequestModel(**data)[source]

Bases: jina.peapods.runtimes.gateway.http.models.JinaRequestModel

Jina HTTP request model that allows customized endpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

exec_endpoint: str