jina.serve.runtimes.gateway.http.models module¶
- class jina.serve.runtimes.gateway.http.models.CustomConfig[source]¶
Bases:
pydantic.config.BaseConfig
Pydantic config for Camel case and enum handling
- use_enum_values = True¶
- allow_population_by_field_name = True¶
- fields = {'data': {'alias': 'data', 'alias_priority': 2}, 'header': {'alias': 'header', 'alias_priority': 2}, 'parameters': {'alias': 'parameters', 'alias_priority': 2}, 'routes': {'alias': 'routes', 'alias_priority': 2}}¶
- jina.serve.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.serve.runtimes.gateway.http.models.JinaHealthModel(**data)[source]¶
Bases:
pydantic.main.BaseModel
Pydantic BaseModel for Jina health check, 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.
- class jina.serve.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 jina.serve.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[docarray.document.pydantic_model.PydanticDocument], Dict[str, List[docarray.document.pydantic_model.PydanticDocument]]]]¶
- target_executor: Optional[str]¶
- parameters: Optional[Dict]¶
- class jina.serve.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.
- header: pydantic.main.HeaderProto¶
- parameters: Dict¶
- routes: List[pydantic.main.RouteProto]¶
- data: Optional[List[docarray.document.pydantic_model.PydanticDocument]]¶
- class jina.serve.runtimes.gateway.http.models.JinaEndpointRequestModel(**data)[source]¶
Bases:
jina.serve.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¶