api_example.endpoints package

Submodules

api_example.endpoints.health module

async health() str[source]

api_example.endpoints.info module

async info()[source]

api_example.endpoints.predict module

class InputData(*, feature_1: float = 10.0)[source]

Bases: BaseModel

feature_1: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'feature_1': FieldInfo(annotation=float, required=False, default=10.0)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

predict(request_data: InputData) dict[source]

Predict the output based on the input data.

Parameters:

request_data (InputData) – The input data for the prediction.

Returns:

The output of the prediction.

Return type:

dict

api_example.endpoints.root module

async default() str[source]

api_example.endpoints.router module

api_example.endpoints.test module

format_output_json(dict_)[source]

Transform the dict with example keys and into format as json.

param dict_:

return:

async test() dict[source]

Module contents