diff --git a/docs-gb/SUMMARY.md b/docs-gb/SUMMARY.md index 5dfd5c1bb..ee14c8c80 100644 --- a/docs-gb/SUMMARY.md +++ b/docs-gb/SUMMARY.md @@ -25,14 +25,22 @@ * [HuggingFace](runtimes/huggingface.md) * [Custom](runtimes/custom.md) * [Reference](reference/README.md) - * [MLServer Settings](reference/settings.md) - * [Model Settings](reference/model-settings.md) - * [MLServer CLI](reference/cli.md) - * [Python API](reference/python-api/README.md) - * [MLModel](reference/api/model.md) - * [Types](reference/api/types.md) + * [MLServer Settings](_build/markdown/settings.md) + * [Model Settings](_build/markdown/model-settings.md) + * [Python API](_reference/python-api_/README.md) + * [MLModel](_build/markdown/settings.md) + * [Model Settings](_build/markdown/model-settings.md) + * [Types](_build/markdown/types.md) * [Codecs](reference/api/codecs.md) + * [Codecs — Built-ins](_build/markdown/codecs-builtins.md) + * [Codecs - Interfaces](_build/markdown/codecs-interfaces.md) * [Metrics](reference/api/metrics.md) + * [Types Reference](_build/api_markdown/types.md) + * [mlserver.types](api/_build/api_markdown/_generated/mlserver.types.md) + * [InferenceRequest](api/_build/_autosummary/mlserver.types.InferenceRequest.md) + * [InferenceErrorResponse](api/_build/_autosummary/mlserver.types.InferenceErrorResponse.md) + * [Types All](_build/api_markdown/types_all.md) + * [Examples](examples/README.md) * [Serving Scikit-Learn models](examples/sklearn/README.md) * [Serving XGBoost models](examples/xgboost/README.md) diff --git a/docs-gb/api/_autosummary/mlserver.types.Datatype.rst b/docs-gb/api/_autosummary/mlserver.types.Datatype.rst new file mode 100644 index 000000000..a941fb7af --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.Datatype.rst @@ -0,0 +1,66 @@ +Datatype +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.Datatype`` + +Overview +-------- +.. autoclass:: mlserver.types.Datatype + :noindex: + :member-order: bysource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.InferenceErrorResponse.rst b/docs-gb/api/_autosummary/mlserver.types.InferenceErrorResponse.rst new file mode 100644 index 000000000..397aadade --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.InferenceErrorResponse.rst @@ -0,0 +1,122 @@ +InferenceErrorResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.InferenceErrorResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.InferenceErrorResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.InferenceErrorResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.InferenceRequest.rst b/docs-gb/api/_autosummary/mlserver.types.InferenceRequest.rst new file mode 100644 index 000000000..8b02955a1 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.InferenceRequest.rst @@ -0,0 +1,131 @@ +InferenceRequest +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.InferenceRequest`` + +Overview +-------- +.. autoclass:: mlserver.types.InferenceRequest + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.InferenceRequest.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.InferenceResponse.rst b/docs-gb/api/_autosummary/mlserver.types.InferenceResponse.rst new file mode 100644 index 000000000..60ba09add --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.InferenceResponse.rst @@ -0,0 +1,134 @@ +InferenceResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.InferenceResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.InferenceResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.InferenceResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.MetadataModelErrorResponse.rst b/docs-gb/api/_autosummary/mlserver.types.MetadataModelErrorResponse.rst new file mode 100644 index 000000000..21c42e085 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.MetadataModelErrorResponse.rst @@ -0,0 +1,122 @@ +MetadataModelErrorResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.MetadataModelErrorResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.MetadataModelErrorResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.MetadataModelErrorResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.MetadataModelResponse.rst b/docs-gb/api/_autosummary/mlserver.types.MetadataModelResponse.rst new file mode 100644 index 000000000..864ae22d1 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.MetadataModelResponse.rst @@ -0,0 +1,137 @@ +MetadataModelResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.MetadataModelResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.MetadataModelResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.MetadataModelResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.MetadataServerErrorResponse.rst b/docs-gb/api/_autosummary/mlserver.types.MetadataServerErrorResponse.rst new file mode 100644 index 000000000..e6117d827 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.MetadataServerErrorResponse.rst @@ -0,0 +1,122 @@ +MetadataServerErrorResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.MetadataServerErrorResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.MetadataServerErrorResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.MetadataServerErrorResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.MetadataServerResponse.rst b/docs-gb/api/_autosummary/mlserver.types.MetadataServerResponse.rst new file mode 100644 index 000000000..535c819a9 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.MetadataServerResponse.rst @@ -0,0 +1,128 @@ +MetadataServerResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.MetadataServerResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.MetadataServerResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.MetadataServerResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.MetadataTensor.rst b/docs-gb/api/_autosummary/mlserver.types.MetadataTensor.rst new file mode 100644 index 000000000..86ca79a3d --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.MetadataTensor.rst @@ -0,0 +1,131 @@ +MetadataTensor +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.MetadataTensor`` + +Overview +-------- +.. autoclass:: mlserver.types.MetadataTensor + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.MetadataTensor.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.Parameters.rst b/docs-gb/api/_autosummary/mlserver.types.Parameters.rst new file mode 100644 index 000000000..796c300fc --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.Parameters.rst @@ -0,0 +1,125 @@ +Parameters +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.Parameters`` + +Overview +-------- +.. autoclass:: mlserver.types.Parameters + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.Parameters.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexRequest.rst b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexRequest.rst new file mode 100644 index 000000000..a7935c9f6 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexRequest.rst @@ -0,0 +1,122 @@ +RepositoryIndexRequest +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RepositoryIndexRequest`` + +Overview +-------- +.. autoclass:: mlserver.types.RepositoryIndexRequest + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RepositoryIndexRequest.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponse.rst b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponse.rst new file mode 100644 index 000000000..d8af5c0db --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponse.rst @@ -0,0 +1,122 @@ +RepositoryIndexResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RepositoryIndexResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.RepositoryIndexResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RepositoryIndexResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponseItem.rst b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponseItem.rst new file mode 100644 index 000000000..4df8ed4b1 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RepositoryIndexResponseItem.rst @@ -0,0 +1,131 @@ +RepositoryIndexResponseItem +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RepositoryIndexResponseItem`` + +Overview +-------- +.. autoclass:: mlserver.types.RepositoryIndexResponseItem + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RepositoryIndexResponseItem.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RepositoryLoadErrorResponse.rst b/docs-gb/api/_autosummary/mlserver.types.RepositoryLoadErrorResponse.rst new file mode 100644 index 000000000..515b4f664 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RepositoryLoadErrorResponse.rst @@ -0,0 +1,122 @@ +RepositoryLoadErrorResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RepositoryLoadErrorResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.RepositoryLoadErrorResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RepositoryLoadErrorResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.rst b/docs-gb/api/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.rst new file mode 100644 index 000000000..d705d7125 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.rst @@ -0,0 +1,122 @@ +RepositoryUnloadErrorResponse +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RepositoryUnloadErrorResponse`` + +Overview +-------- +.. autoclass:: mlserver.types.RepositoryUnloadErrorResponse + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RepositoryUnloadErrorResponse.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RequestInput.rst b/docs-gb/api/_autosummary/mlserver.types.RequestInput.rst new file mode 100644 index 000000000..a6ba0a2e2 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RequestInput.rst @@ -0,0 +1,134 @@ +RequestInput +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RequestInput`` + +Overview +-------- +.. autoclass:: mlserver.types.RequestInput + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RequestInput.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.RequestOutput.rst b/docs-gb/api/_autosummary/mlserver.types.RequestOutput.rst new file mode 100644 index 000000000..bdd5bce69 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.RequestOutput.rst @@ -0,0 +1,125 @@ +RequestOutput +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.RequestOutput`` + +Overview +-------- +.. autoclass:: mlserver.types.RequestOutput + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.RequestOutput.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.ResponseOutput.rst b/docs-gb/api/_autosummary/mlserver.types.ResponseOutput.rst new file mode 100644 index 000000000..77c49cf68 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.ResponseOutput.rst @@ -0,0 +1,134 @@ +ResponseOutput +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.ResponseOutput`` + +Overview +-------- +.. autoclass:: mlserver.types.ResponseOutput + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.ResponseOutput.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.State.rst b/docs-gb/api/_autosummary/mlserver.types.State.rst new file mode 100644 index 000000000..55f617629 --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.State.rst @@ -0,0 +1,42 @@ +State +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.State`` + +Overview +-------- +.. autoclass:: mlserver.types.State + :noindex: + :member-order: bysource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_autosummary/mlserver.types.TensorData.rst b/docs-gb/api/_autosummary/mlserver.types.TensorData.rst new file mode 100644 index 000000000..da0ea386c --- /dev/null +++ b/docs-gb/api/_autosummary/mlserver.types.TensorData.rst @@ -0,0 +1,122 @@ +TensorData +============ + +.. currentmodule:: mlserver.types + +**Qualified name:** ``mlserver.types.TensorData`` + +Overview +-------- +.. autoclass:: mlserver.types.TensorData + :noindex: + :member-order: bysource + + + + + + +Constructor +----------- +.. automethod:: mlserver.types.TensorData.__init__ + :noindex: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.Datatype.md b/docs-gb/api/_build/_autosummary/mlserver.types.Datatype.md new file mode 100644 index 000000000..7f0cac78f --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.Datatype.md @@ -0,0 +1,35 @@ +# Datatype + +**Qualified name:** `mlserver.types.Datatype` + +## Overview + +### *class* mlserver.types.Datatype + +Bases: `Enum` + +#### BOOL *= 'BOOL'* + +#### UINT8 *= 'UINT8'* + +#### UINT16 *= 'UINT16'* + +#### UINT32 *= 'UINT32'* + +#### UINT64 *= 'UINT64'* + +#### INT8 *= 'INT8'* + +#### INT16 *= 'INT16'* + +#### INT32 *= 'INT32'* + +#### INT64 *= 'INT64'* + +#### FP16 *= 'FP16'* + +#### FP32 *= 'FP32'* + +#### FP64 *= 'FP64'* + +#### BYTES *= 'BYTES'* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.InferenceErrorResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceErrorResponse.md new file mode 100644 index 000000000..ef0974a2b --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceErrorResponse.md @@ -0,0 +1,389 @@ +# InferenceErrorResponse + +**Qualified name:** `mlserver.types.InferenceErrorResponse` + +## Overview + +### *class* mlserver.types.InferenceErrorResponse + +Bases: `BaseModel` + +#### error *: str | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'error': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### InferenceErrorResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.InferenceRequest.md b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceRequest.md new file mode 100644 index 000000000..581f92dc0 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceRequest.md @@ -0,0 +1,395 @@ +# InferenceRequest + +**Qualified name:** `mlserver.types.InferenceRequest` + +## Overview + +### *class* mlserver.types.InferenceRequest + +Bases: `BaseModel` + +#### id *: str | None* + +#### parameters *: Parameters | None* + +#### inputs *: List[RequestInput]* + +#### outputs *: List[RequestOutput] | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'inputs': FieldInfo(annotation=List[RequestInput], required=True), 'outputs': FieldInfo(annotation=Union[List[RequestOutput], NoneType], required=False, default=None), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### InferenceRequest.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.InferenceResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceResponse.md new file mode 100644 index 000000000..eb10142ca --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.InferenceResponse.md @@ -0,0 +1,397 @@ +# InferenceResponse + +**Qualified name:** `mlserver.types.InferenceResponse` + +## Overview + +### *class* mlserver.types.InferenceResponse + +Bases: `BaseModel` + +#### model_name *: str* + +#### model_version *: str | None* + +#### id *: str | None* + +#### parameters *: Parameters | None* + +#### outputs *: List[ResponseOutput]* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'model_name': FieldInfo(annotation=str, required=True), 'model_version': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'outputs': FieldInfo(annotation=List[ResponseOutput], required=True), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### InferenceResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelErrorResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelErrorResponse.md new file mode 100644 index 000000000..fa1552eff --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelErrorResponse.md @@ -0,0 +1,389 @@ +# MetadataModelErrorResponse + +**Qualified name:** `mlserver.types.MetadataModelErrorResponse` + +## Overview + +### *class* mlserver.types.MetadataModelErrorResponse + +Bases: `BaseModel` + +#### error *: str* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'error': FieldInfo(annotation=str, required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### MetadataModelErrorResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelResponse.md new file mode 100644 index 000000000..1f5bf412f --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataModelResponse.md @@ -0,0 +1,399 @@ +# MetadataModelResponse + +**Qualified name:** `mlserver.types.MetadataModelResponse` + +## Overview + +### *class* mlserver.types.MetadataModelResponse + +Bases: `BaseModel` + +#### name *: str* + +#### versions *: List[str] | None* + +#### platform *: str* + +#### inputs *: List[MetadataTensor] | None* + +#### outputs *: List[MetadataTensor] | None* + +#### parameters *: Parameters | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'inputs': FieldInfo(annotation=Union[List[MetadataTensor], NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'outputs': FieldInfo(annotation=Union[List[MetadataTensor], NoneType], required=False, default=None), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None), 'platform': FieldInfo(annotation=str, required=True), 'versions': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### MetadataModelResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerErrorResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerErrorResponse.md new file mode 100644 index 000000000..9dbb27fa8 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerErrorResponse.md @@ -0,0 +1,389 @@ +# MetadataServerErrorResponse + +**Qualified name:** `mlserver.types.MetadataServerErrorResponse` + +## Overview + +### *class* mlserver.types.MetadataServerErrorResponse + +Bases: `BaseModel` + +#### error *: str* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'error': FieldInfo(annotation=str, required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### MetadataServerErrorResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerResponse.md new file mode 100644 index 000000000..241c68855 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataServerResponse.md @@ -0,0 +1,393 @@ +# MetadataServerResponse + +**Qualified name:** `mlserver.types.MetadataServerResponse` + +## Overview + +### *class* mlserver.types.MetadataServerResponse + +Bases: `BaseModel` + +#### name *: str* + +#### version *: str* + +#### extensions *: List[str]* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'extensions': FieldInfo(annotation=List[str], required=True), 'name': FieldInfo(annotation=str, required=True), 'version': FieldInfo(annotation=str, required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### MetadataServerResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.MetadataTensor.md b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataTensor.md new file mode 100644 index 000000000..e2b3e3618 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.MetadataTensor.md @@ -0,0 +1,395 @@ +# MetadataTensor + +**Qualified name:** `mlserver.types.MetadataTensor` + +## Overview + +### *class* mlserver.types.MetadataTensor + +Bases: `BaseModel` + +#### name *: str* + +#### datatype *: Datatype* + +#### shape *: List[int]* + +#### parameters *: Parameters | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'datatype': FieldInfo(annotation=Datatype, required=True), 'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None), 'shape': FieldInfo(annotation=List[int], required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### MetadataTensor.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.Parameters.md b/docs-gb/api/_build/_autosummary/mlserver.types.Parameters.md new file mode 100644 index 000000000..5f55685a1 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.Parameters.md @@ -0,0 +1,391 @@ +# Parameters + +**Qualified name:** `mlserver.types.Parameters` + +## Overview + +### *class* mlserver.types.Parameters + +Bases: `BaseModel` + +#### model_config *: ClassVar[ConfigDict]* *= {'extra': 'allow', 'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### content_type *: str | None* + +#### headers *: Dict[str, Any] | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'content_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'headers': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### Parameters.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexRequest.md b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexRequest.md new file mode 100644 index 000000000..747ba599b --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexRequest.md @@ -0,0 +1,389 @@ +# RepositoryIndexRequest + +**Qualified name:** `mlserver.types.RepositoryIndexRequest` + +## Overview + +### *class* mlserver.types.RepositoryIndexRequest + +Bases: `BaseModel` + +#### ready *: bool | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'ready': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RepositoryIndexRequest.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponse.md new file mode 100644 index 000000000..e3daa716e --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponse.md @@ -0,0 +1,383 @@ +# RepositoryIndexResponse + +**Qualified name:** `mlserver.types.RepositoryIndexResponse` + +## Overview + +### *class* mlserver.types.RepositoryIndexResponse + +Bases: `RootModel[List[RepositoryIndexResponseItem]]` + +#### root *: List[RepositoryIndexResponseItem]* + +#### \_\_init_\_(root=PydanticUndefined, \*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **root** (*RootModelRootType*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### 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]. + +#### *classmethod* model_construct(root, \_fields_set=None) + +Create a new model using the provided root object and update fields set. + +* **Parameters:** + * **root** (*RootModelRootType*) – The root object of the model. + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – The set of fields to be updated. +* **Returns:** + The new model. +* **Raises:** + **NotImplemented** – If the model is not a subclass of RootModel. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(\*, mode='python', include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** (*Literal* *[* *'json'* *,* *'python'* *]* *|* *str*) – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – A set of fields to include in the output. + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – A set of fields to exclude from the output. + * **context** (*Any* *|* *None*) – Additional context to pass to the serializer. + * **by_alias** (*bool*) – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** (*bool*) – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** (*bool*) – Whether to exclude fields that are set to their default value. + * **exclude_none** (*bool*) – Whether to exclude fields that have a value of None. + * **round_trip** (*bool*) – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** (*bool* *|* *Literal* *[* *'none'* *,* *'warn'* *,* *'error'* *]*) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** (*bool*) – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. +* **Return type:** + *dict*[*str*, *Any*] + +#### model_dump_json(\*, indent=None, include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** (*int* *|* *None*) – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – Field(s) to include in the JSON output. + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – Field(s) to exclude from the JSON output. + * **context** (*Any* *|* *None*) – Additional context to pass to the serializer. + * **by_alias** (*bool*) – Whether to serialize using field aliases. + * **exclude_unset** (*bool*) – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** (*bool*) – Whether to exclude fields that are set to their default value. + * **exclude_none** (*bool*) – Whether to exclude fields that have a value of None. + * **round_trip** (*bool*) – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** (*bool* *|* *Literal* *[* *'none'* *,* *'warn'* *,* *'error'* *]*) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** (*bool*) – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. +* **Return type:** + *str* + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'root': FieldInfo(annotation=List[RepositoryIndexResponseItem], required=True, title='RepositoryIndexResponse')}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RepositoryIndexResponse.\_\_init_\_(root=PydanticUndefined, \*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **root** (*RootModelRootType*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponseItem.md b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponseItem.md new file mode 100644 index 000000000..afc7d52c4 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryIndexResponseItem.md @@ -0,0 +1,395 @@ +# RepositoryIndexResponseItem + +**Qualified name:** `mlserver.types.RepositoryIndexResponseItem` + +## Overview + +### *class* mlserver.types.RepositoryIndexResponseItem + +Bases: `BaseModel` + +#### name *: str* + +#### version *: str | None* + +#### state *: State* + +#### reason *: str* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'name': FieldInfo(annotation=str, required=True), 'reason': FieldInfo(annotation=str, required=True), 'state': FieldInfo(annotation=State, required=True), 'version': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RepositoryIndexResponseItem.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryLoadErrorResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryLoadErrorResponse.md new file mode 100644 index 000000000..5a8321db3 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryLoadErrorResponse.md @@ -0,0 +1,389 @@ +# RepositoryLoadErrorResponse + +**Qualified name:** `mlserver.types.RepositoryLoadErrorResponse` + +## Overview + +### *class* mlserver.types.RepositoryLoadErrorResponse + +Bases: `BaseModel` + +#### error *: str | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'error': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RepositoryLoadErrorResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.md b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.md new file mode 100644 index 000000000..8cc270318 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RepositoryUnloadErrorResponse.md @@ -0,0 +1,389 @@ +# RepositoryUnloadErrorResponse + +**Qualified name:** `mlserver.types.RepositoryUnloadErrorResponse` + +## Overview + +### *class* mlserver.types.RepositoryUnloadErrorResponse + +Bases: `BaseModel` + +#### error *: str | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'error': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RepositoryUnloadErrorResponse.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RequestInput.md b/docs-gb/api/_build/_autosummary/mlserver.types.RequestInput.md new file mode 100644 index 000000000..547713d5e --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RequestInput.md @@ -0,0 +1,397 @@ +# RequestInput + +**Qualified name:** `mlserver.types.RequestInput` + +## Overview + +### *class* mlserver.types.RequestInput + +Bases: `BaseModel` + +#### name *: str* + +#### shape *: List[int]* + +#### datatype *: Datatype* + +#### parameters *: Parameters | None* + +#### data *: TensorData* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'data': FieldInfo(annotation=TensorData, required=True), 'datatype': FieldInfo(annotation=Datatype, required=True), 'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None), 'shape': FieldInfo(annotation=List[int], required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RequestInput.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.RequestOutput.md b/docs-gb/api/_build/_autosummary/mlserver.types.RequestOutput.md new file mode 100644 index 000000000..e54a99938 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.RequestOutput.md @@ -0,0 +1,391 @@ +# RequestOutput + +**Qualified name:** `mlserver.types.RequestOutput` + +## Overview + +### *class* mlserver.types.RequestOutput + +Bases: `BaseModel` + +#### name *: str* + +#### parameters *: Parameters | None* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### RequestOutput.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.ResponseOutput.md b/docs-gb/api/_build/_autosummary/mlserver.types.ResponseOutput.md new file mode 100644 index 000000000..b662f2b91 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.ResponseOutput.md @@ -0,0 +1,397 @@ +# ResponseOutput + +**Qualified name:** `mlserver.types.ResponseOutput` + +## Overview + +### *class* mlserver.types.ResponseOutput + +Bases: `BaseModel` + +#### name *: str* + +#### shape *: List[int]* + +#### datatype *: Datatype* + +#### parameters *: Parameters | None* + +#### data *: TensorData* + +#### \_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### model_computed_fields *: ClassVar[Dict[str, ComputedFieldInfo]]* *= {}* + +A dictionary of computed field names and their corresponding ComputedFieldInfo objects. + +#### model_config *: ClassVar[ConfigDict]* *= {'protected_namespaces': (), 'use_enum_values': True}* + +Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. + +#### *classmethod* model_construct(\_fields_set=None, \*\*values) + +Creates a new instance of the Model class with validated data. + +Creates a new model setting \_\_dict_\_ and \_\_pydantic_fields_set_\_ from trusted or pre-validated data. +Default values are respected, but no other validation is performed. + +!!! note +: model_construct() generally respects the model_config.extra setting on the provided model. + That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s \_\_dict_\_ + and \_\_pydantic_extra_\_ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. + Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in + an error if extra values are passed, but they will be ignored. + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – A set of field names that were originally explicitly set during instantiation. If provided, + this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. + Otherwise, the field names from the values argument will be used. + * **values** (*Any*) – Trusted or pre-validated data dictionary. +* **Returns:** + A new instance of the Model class with validated data. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** – A set of fields to include in the output. + * **exclude** – A set of fields to exclude from the output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. + +#### model_dump_json(exclude_unset=True, exclude_none=True, \*\*kwargs) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** – Field(s) to include in the JSON output. + * **exclude** – Field(s) to exclude from the JSON output. + * **context** – Additional context to pass to the serializer. + * **by_alias** – Whether to serialize using field aliases. + * **exclude_unset** – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** – Whether to exclude fields that are set to their default value. + * **exclude_none** – Whether to exclude fields that have a value of None. + * **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'data': FieldInfo(annotation=TensorData, required=True), 'datatype': FieldInfo(annotation=Datatype, required=True), 'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=Union[Parameters, NoneType], required=False, default=None), 'shape': FieldInfo(annotation=List[int], required=True)}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### ResponseOutput.\_\_init_\_(\*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **data** (*Any*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.State.md b/docs-gb/api/_build/_autosummary/mlserver.types.State.md new file mode 100644 index 000000000..748db3b0f --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.State.md @@ -0,0 +1,19 @@ +# State + +**Qualified name:** `mlserver.types.State` + +## Overview + +### *class* mlserver.types.State + +Bases: `Enum` + +#### UNKNOWN *= 'UNKNOWN'* + +#### READY *= 'READY'* + +#### UNAVAILABLE *= 'UNAVAILABLE'* + +#### LOADING *= 'LOADING'* + +#### UNLOADING *= 'UNLOADING'* diff --git a/docs-gb/api/_build/_autosummary/mlserver.types.TensorData.md b/docs-gb/api/_build/_autosummary/mlserver.types.TensorData.md new file mode 100644 index 000000000..0858175b5 --- /dev/null +++ b/docs-gb/api/_build/_autosummary/mlserver.types.TensorData.md @@ -0,0 +1,383 @@ +# TensorData + +**Qualified name:** `mlserver.types.TensorData` + +## Overview + +### *class* mlserver.types.TensorData + +Bases: `RootModel[Union[List, Any]]` + +#### root *: List | Any* + +#### \_\_init_\_(root=PydanticUndefined, \*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **root** (*RootModelRootType*) – +* **Return type:** + *None* + +#### *classmethod* construct(\_fields_set=None, \*\*values) + +* **Parameters:** + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – + * **values** (*Any*) – +* **Return type:** + *Self* + +#### copy(\*, include=None, exclude=None, update=None, deep=False) + +Returns a copy of the model. + +!!! warning “Deprecated” +: This method is now deprecated; use model_copy instead. + +If you need include or exclude, use: + +``py +data = self.model_dump(include=include, exclude=exclude, round_trip=True) +data = {**data, **(update or {})} +copied = self.model_validate(data) +`` + +* **Parameters:** + * **include** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to include in the copied model. + * **exclude** (*AbstractSetIntStr* *|* *MappingIntStrAny* *|* *None*) – Optional set or mapping specifying which fields to exclude in the copied model. + * **update** (*Dict* *[**str* *,* *Any* *]* *|* *None*) – Optional dictionary of field-value pairs to override field values in the copied model. + * **deep** (*bool*) – If True, the values of fields that are Pydantic models will be deep-copied. +* **Returns:** + A copy of the model with included, excluded and updated fields as specified. +* **Return type:** + *Self* + +#### dict(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* from_orm(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### json(\*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, \*\*dumps_kwargs) + +* **Parameters:** + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – + * **by_alias** (*bool*) – + * **exclude_unset** (*bool*) – + * **exclude_defaults** (*bool*) – + * **exclude_none** (*bool*) – + * **encoder** (*Callable* *[* *[**Any* *]* *,* *Any* *]* *|* *None*) – + * **models_as_dict** (*bool*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### 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]. + +#### *classmethod* model_construct(root, \_fields_set=None) + +Create a new model using the provided root object and update fields set. + +* **Parameters:** + * **root** (*RootModelRootType*) – The root object of the model. + * **\_fields_set** (*set* *[**str* *]* *|* *None*) – The set of fields to be updated. +* **Returns:** + The new model. +* **Raises:** + **NotImplemented** – If the model is not a subclass of RootModel. +* **Return type:** + *Self* + +#### model_copy(\*, update=None, deep=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy](https://docs.pydantic.dev/2.9/concepts/serialization/#model_copy) + +Returns a copy of the model. + +* **Parameters:** + * **update** (*dict* *[**str* *,* *Any* *]* *|* *None*) – Values to change/add in the new model. Note: the data is not validated + before creating the new model. You should trust this data. + * **deep** (*bool*) – Set to True to make a deep copy of the model. +* **Returns:** + New model instance. +* **Return type:** + *Self* + +#### model_dump(\*, mode='python', include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump) + +Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + +* **Parameters:** + * **mode** (*Literal* *[* *'json'* *,* *'python'* *]* *|* *str*) – The mode in which to_python should run. + If mode is ‘json’, the output will only contain JSON serializable types. + If mode is ‘python’, the output may contain non-JSON-serializable Python objects. + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – A set of fields to include in the output. + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – A set of fields to exclude from the output. + * **context** (*Any* *|* *None*) – Additional context to pass to the serializer. + * **by_alias** (*bool*) – Whether to use the field’s alias in the dictionary key if defined. + * **exclude_unset** (*bool*) – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** (*bool*) – Whether to exclude fields that are set to their default value. + * **exclude_none** (*bool*) – Whether to exclude fields that have a value of None. + * **round_trip** (*bool*) – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** (*bool* *|* *Literal* *[* *'none'* *,* *'warn'* *,* *'error'* *]*) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** (*bool*) – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A dictionary representation of the model. +* **Return type:** + *dict*[*str*, *Any*] + +#### model_dump_json(\*, indent=None, include=None, exclude=None, context=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, round_trip=False, warnings=True, serialize_as_any=False) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json](https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump_json) + +Generates a JSON representation of the model using Pydantic’s to_json method. + +* **Parameters:** + * **indent** (*int* *|* *None*) – Indentation to use in the JSON output. If None is passed, the output will be compact. + * **include** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – Field(s) to include in the JSON output. + * **exclude** (*Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *Set* *[**int* *]* *|* *Set* *[**str* *]* *|* *Mapping* *[**int* *,* *IncEx* *|* *Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *~typing.Set* *[**int* *]* *|* *~typing.Set* *[**str* *]* *|* *~typing.Mapping* *[**int* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Mapping* *[**str* *,* *IncEx* *|* *~typing.Literal* *[**True* *]* *]* *|* *~typing.Literal* *[**True* *]* *]* *|* *None*) – Field(s) to exclude from the JSON output. + * **context** (*Any* *|* *None*) – Additional context to pass to the serializer. + * **by_alias** (*bool*) – Whether to serialize using field aliases. + * **exclude_unset** (*bool*) – Whether to exclude fields that have not been explicitly set. + * **exclude_defaults** (*bool*) – Whether to exclude fields that are set to their default value. + * **exclude_none** (*bool*) – Whether to exclude fields that have a value of None. + * **round_trip** (*bool*) – If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + * **warnings** (*bool* *|* *Literal* *[* *'none'* *,* *'warn'* *,* *'error'* *]*) – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, + “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError]. + * **serialize_as_any** (*bool*) – Whether to serialize fields with duck-typing serialization behavior. +* **Returns:** + A JSON string representation of the model. +* **Return type:** + *str* + +#### *property* model_extra *: dict[str, Any] | None* + +Get extra fields set during validation. + +* **Returns:** + A dictionary of extra fields, or None if config.extra is not set to “allow”. + +#### model_fields *: ClassVar[Dict[str, FieldInfo]]* *= {'root': FieldInfo(annotation=Union[List, Any], required=True, title='TensorData')}* + +Metadata about the fields defined on the model, +mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects. + +This replaces Model._\_fields_\_ from Pydantic V1. + +#### *property* model_fields_set *: set[str]* + +Returns the set of fields that have been explicitly set on this model instance. + +* **Returns:** + A set of strings representing the fields that have been set, + : i.e. that were not filled from defaults. + +#### *classmethod* model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=, mode='validation') + +Generates a JSON schema for a model class. + +* **Parameters:** + * **by_alias** (*bool*) – Whether to use attribute aliases or not. + * **ref_template** (*str*) – The reference template. + * **schema_generator** (*type* *[**pydantic.json_schema.GenerateJsonSchema* *]*) – To override the logic used to generate the JSON schema, as a subclass of + GenerateJsonSchema with your desired modifications + * **mode** (*Literal* *[* *'validation'* *,* *'serialization'* *]*) – The mode in which to generate the schema. +* **Returns:** + The JSON schema for the given model class. +* **Return type:** + *dict*[*str*, *Any*] + +#### *classmethod* model_parametrized_name(params) + +Compute the class name for parametrizations of generic classes. + +This method can be overridden to achieve a custom naming scheme for generic BaseModels. + +* **Parameters:** + **params** (*tuple* *[**type* *[**Any* *]* *,* *...* *]*) – Tuple of types of the class. Given a generic class + Model with 2 type variables and a concrete model Model[str, int], + the value (str, int) would be passed to params. +* **Returns:** + String representing the new class where params are passed to cls as type variables. +* **Raises:** + **TypeError** – Raised when trying to generate concrete names for non-generic models. +* **Return type:** + *str* + +#### model_post_init(\_BaseModel_\_context) + +Override this method to perform additional initialization after \_\_init_\_ and model_construct. +This is useful if you want to do some validation that requires the entire model to be initialized. + +* **Parameters:** + **\_BaseModel_\_context** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* model_rebuild(\*, force=False, raise_errors=True, \_parent_namespace_depth=2, \_types_namespace=None) + +Try to rebuild the pydantic-core schema for the model. + +This may be necessary when one of the annotations is a ForwardRef which could not be resolved during +the initial attempt to build the schema, and automatic rebuilding fails. + +* **Parameters:** + * **force** (*bool*) – Whether to force the rebuilding of the model schema, defaults to False. + * **raise_errors** (*bool*) – Whether to raise errors, defaults to True. + * **\_parent_namespace_depth** (*int*) – The depth level of the parent namespace, defaults to 2. + * **\_types_namespace** (*dict* *[**str* *,* *Any* *]* *|* *None*) – The types namespace, defaults to None. +* **Returns:** + Returns None if the schema is already “complete” and rebuilding was not required. + If rebuilding \_was_ required, returns True if rebuilding was successful, otherwise False. +* **Return type:** + *bool* | *None* + +#### *classmethod* model_validate(obj, \*, strict=None, from_attributes=None, context=None) + +Validate a pydantic model instance. + +* **Parameters:** + * **obj** (*Any*) – The object to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **from_attributes** (*bool* *|* *None*) – Whether to extract data from object attributes. + * **context** (*Any* *|* *None*) – Additional context to pass to the validator. +* **Raises:** + **ValidationError** – If the object could not be validated. +* **Returns:** + The validated model instance. +* **Return type:** + *Self* + +#### *classmethod* model_validate_json(json_data, \*, strict=None, context=None) + +Usage docs: [https://docs.pydantic.dev/2.9/concepts/json/#json-parsing](https://docs.pydantic.dev/2.9/concepts/json/#json-parsing) + +Validate the given JSON data against the Pydantic model. + +* **Parameters:** + * **json_data** (*str* *|* *bytes* *|* *bytearray*) – The JSON data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Raises:** + **ValidationError** – If json_data is not a JSON string or the object could not be validated. +* **Return type:** + *Self* + +#### *classmethod* model_validate_strings(obj, \*, strict=None, context=None) + +Validate the given object with string data against the Pydantic model. + +* **Parameters:** + * **obj** (*Any*) – The object containing string data to validate. + * **strict** (*bool* *|* *None*) – Whether to enforce types strictly. + * **context** (*Any* *|* *None*) – Extra variables to pass to the validator. +* **Returns:** + The validated Pydantic model. +* **Return type:** + *Self* + +#### *classmethod* parse_file(path, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **path** (*str* *|* *Path*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* parse_obj(obj) + +* **Parameters:** + **obj** (*Any*) – +* **Return type:** + *Self* + +#### *classmethod* parse_raw(b, \*, content_type=None, encoding='utf8', proto=None, allow_pickle=False) + +* **Parameters:** + * **b** (*str* *|* *bytes*) – + * **content_type** (*str* *|* *None*) – + * **encoding** (*str*) – + * **proto** (*DeprecatedParseProtocol* *|* *None*) – + * **allow_pickle** (*bool*) – +* **Return type:** + *Self* + +#### *classmethod* schema(by_alias=True, ref_template='#/$defs/{model}') + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – +* **Return type:** + *Dict*[*str*, *Any*] + +#### *classmethod* schema_json(\*, by_alias=True, ref_template='#/$defs/{model}', \*\*dumps_kwargs) + +* **Parameters:** + * **by_alias** (*bool*) – + * **ref_template** (*str*) – + * **dumps_kwargs** (*Any*) – +* **Return type:** + *str* + +#### *classmethod* update_forward_refs(\*\*localns) + +* **Parameters:** + **localns** (*Any*) – +* **Return type:** + *None* + +#### *classmethod* validate(value) + +* **Parameters:** + **value** (*Any*) – +* **Return type:** + *Self* + +## Constructor + +#### TensorData.\_\_init_\_(root=PydanticUndefined, \*\*data) + +Create a new model by parsing and validating input data from keyword arguments. + +Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be +validated to form a valid model. + +self is explicitly positional-only to allow self as a field name. + +* **Parameters:** + **root** (*RootModelRootType*) – +* **Return type:** + *None* diff --git a/docs-gb/api/_build/index.md b/docs-gb/api/_build/index.md new file mode 100644 index 000000000..aeacb55ea --- /dev/null +++ b/docs-gb/api/_build/index.md @@ -0,0 +1,23 @@ +# API Reference + +* [Types](types.md) + * [Datatype](_autosummary/mlserver.types.Datatype.md) + * [InferenceErrorResponse](_autosummary/mlserver.types.InferenceErrorResponse.md) + * [InferenceRequest](_autosummary/mlserver.types.InferenceRequest.md) + * [InferenceResponse](_autosummary/mlserver.types.InferenceResponse.md) + * [MetadataModelErrorResponse](_autosummary/mlserver.types.MetadataModelErrorResponse.md) + * [MetadataModelResponse](_autosummary/mlserver.types.MetadataModelResponse.md) + * [MetadataServerErrorResponse](_autosummary/mlserver.types.MetadataServerErrorResponse.md) + * [MetadataServerResponse](_autosummary/mlserver.types.MetadataServerResponse.md) + * [MetadataTensor](_autosummary/mlserver.types.MetadataTensor.md) + * [Parameters](_autosummary/mlserver.types.Parameters.md) + * [RepositoryIndexRequest](_autosummary/mlserver.types.RepositoryIndexRequest.md) + * [RepositoryIndexResponse](_autosummary/mlserver.types.RepositoryIndexResponse.md) + * [RepositoryIndexResponseItem](_autosummary/mlserver.types.RepositoryIndexResponseItem.md) + * [RepositoryLoadErrorResponse](_autosummary/mlserver.types.RepositoryLoadErrorResponse.md) + * [RepositoryUnloadErrorResponse](_autosummary/mlserver.types.RepositoryUnloadErrorResponse.md) + * [RequestInput](_autosummary/mlserver.types.RequestInput.md) + * [RequestOutput](_autosummary/mlserver.types.RequestOutput.md) + * [ResponseOutput](_autosummary/mlserver.types.ResponseOutput.md) + * [State](_autosummary/mlserver.types.State.md) + * [TensorData](_autosummary/mlserver.types.TensorData.md) diff --git a/docs-gb/api/_build/types.md b/docs-gb/api/_build/types.md new file mode 100644 index 000000000..1ca14aeb0 --- /dev/null +++ b/docs-gb/api/_build/types.md @@ -0,0 +1,23 @@ +# Types + +| `mlserver.types.Datatype` | | +|------------------------------------------------|----| +| `mlserver.types.InferenceErrorResponse` | | +| `mlserver.types.InferenceRequest` | | +| `mlserver.types.InferenceResponse` | | +| `mlserver.types.MetadataModelErrorResponse` | | +| `mlserver.types.MetadataModelResponse` | | +| `mlserver.types.MetadataServerErrorResponse` | | +| `mlserver.types.MetadataServerResponse` | | +| `mlserver.types.MetadataTensor` | | +| `mlserver.types.Parameters` | | +| `mlserver.types.RepositoryIndexRequest` | | +| `mlserver.types.RepositoryIndexResponse` | | +| `mlserver.types.RepositoryIndexResponseItem` | | +| `mlserver.types.RepositoryLoadErrorResponse` | | +| `mlserver.types.RepositoryUnloadErrorResponse` | | +| `mlserver.types.RequestInput` | | +| `mlserver.types.RequestOutput` | | +| `mlserver.types.ResponseOutput` | | +| `mlserver.types.State` | | +| `mlserver.types.TensorData` | | diff --git a/docs-gb/api/_templates/autosummary/class.rst b/docs-gb/api/_templates/autosummary/class.rst new file mode 100644 index 000000000..eeb5d8b23 --- /dev/null +++ b/docs-gb/api/_templates/autosummary/class.rst @@ -0,0 +1,60 @@ +{{ objname }} +============ + +.. currentmodule:: {{ module }} + +**Qualified name:** ``{{ fullname }}``{% if bases %} +**Bases:** {{ ", ".join(bases) }}{% endif %} + +Overview +-------- +.. autoclass:: {{ fullname }} + :noindex: + :member-order: bysource + +{# Normalize helpers: attributes/methods may be strings or objects #} +{% set _attrs = attributes or [] %} +{% set _meths = methods or [] %} + +{% if "__init__" in (_meths if _meths and (_meths[0] is string) else (_meths | map(attribute="name") | list)) %} +Constructor +----------- +.. automethod:: {{ fullname }}.__init__ + :noindex: +{% endif %} + +{% set has_pub_attrs = false %} +{% for a in _attrs %} + {% set aname = a if (a is string) else a.name %} + {% if not aname.startswith('_') %}{% set has_pub_attrs = true %}{% endif %} +{% endfor %} + +{% if has_pub_attrs %} +Fields +------ +{% for a in _attrs %} + {% set aname = a if (a is string) else a.name %} + {% if not aname.startswith('_') %} +.. autoattribute:: {{ fullname }}.{{ aname }} + :noindex: + {% endif %} +{% endfor %} +{% endif %} + +{% set has_pub_methods = false %} +{% for m in _meths %} + {% set mname = m if (m is string) else m.name %} + {% if not mname.startswith('_') and mname != "__init__" %}{% set has_pub_methods = true %}{% endif %} +{% endfor %} + +{% if has_pub_methods %} +Methods +------- +{% for m in _meths %} + {% set mname = m if (m is string) else m.name %} + {% if not mname.startswith('_') and mname != "__init__" %} +.. automethod:: {{ fullname }}.{{ mname }} + :noindex: + {% endif %} +{% endfor %} +{% endif %} diff --git a/docs-gb/api/_templates/autosummary/module.rst b/docs-gb/api/_templates/autosummary/module.rst new file mode 100644 index 000000000..95fb19006 --- /dev/null +++ b/docs-gb/api/_templates/autosummary/module.rst @@ -0,0 +1,9 @@ +{{ objname }} module +==================== +**TEMPLATE_USED: MODULE.RST** + +.. automodule:: {{ fullname }} + :members: + + + diff --git a/docs-gb/api/conf.py b/docs-gb/api/conf.py new file mode 100644 index 000000000..6858bc5b3 --- /dev/null +++ b/docs-gb/api/conf.py @@ -0,0 +1,74 @@ +# Make sure imports work from the repo root +import os, sys +sys.path.insert(0, os.path.abspath("..")) + +print("CONF LOADED FROM:", __file__) + +extensions = [ + "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", + # "sphinxcontrib.autodoc_pydantic", + "sphinx.ext.autosummary", + "sphinx_markdown_builder", +] + + +source_suffix = { + ".rst": "restructuredtext", + ".md": "myst", +} + +root_doc = "index" + +autosummary_generate = True +autosummary_generate_overwrite = True + +autodoc_pydantic_settings_show_json = False +autodoc_pydantic_model_show_json = False + +autosummary_imported_members = False + +exclude_patterns = ["_build", ".doctrees", "Thumbs.db", ".DS_Store"] + +autodoc_default_options = { + "members": True, + "inherited-members": True, + "undoc-members": True, + "show-inheritance": True, +} + +myst_heading_anchors = 6 + +# Templates (adjust if your Jinja lives elsewhere) +templates_path = ["_templates"] + +autodoc_mock_imports = ["torch", "tensorflow", "onnxruntime"] + +# put the __init__ signature in a separate block (not in the heading) +autodoc_class_signature = "separated" # default is "mixed" + +# move type hints into the description instead of the signature +autodoc_typehints = "description" + +# shorten fully-qualified type names (e.g., List[int] instead of typing.List[int]) +python_use_unqualified_type_names = True + + + +exclude_patterns = [ + "_build", ".doctrees", "Thumbs.db", ".DS_Store", + "**/PULL_REQUEST_TEMPLATE/**", # ignore repo hygiene files + "**/.github/**", # if present +] + +myst_enable_extensions = ["colon_fence", "deflist", "fieldlist", "tasklist"] +myst_heading_anchors = 6 + + +print("CONF: autosummary_generate =", globals().get("autosummary_generate")) +print("CONF: myst_enable_extensions =", globals().get("myst_enable_extensions")) + +print("TEMPLATES PATH:", [os.path.abspath(path) for path in templates_path]) + diff --git a/docs-gb/api/index.rst b/docs-gb/api/index.rst new file mode 100644 index 000000000..3d61f8ca7 --- /dev/null +++ b/docs-gb/api/index.rst @@ -0,0 +1,7 @@ +API Reference +============= + +.. toctree:: + :maxdepth: 2 + + types \ No newline at end of file diff --git a/docs-gb/api/types.rst b/docs-gb/api/types.rst new file mode 100644 index 000000000..265ca923d --- /dev/null +++ b/docs-gb/api/types.rst @@ -0,0 +1,28 @@ +Types +===== + +.. autosummary:: + :toctree: _autosummary + + mlserver.types.Datatype + mlserver.types.InferenceErrorResponse + mlserver.types.InferenceRequest + mlserver.types.InferenceResponse + mlserver.types.MetadataModelErrorResponse + mlserver.types.MetadataModelResponse + mlserver.types.MetadataServerErrorResponse + mlserver.types.MetadataServerResponse + mlserver.types.MetadataTensor + mlserver.types.Parameters + mlserver.types.RepositoryIndexRequest + mlserver.types.RepositoryIndexResponse + mlserver.types.RepositoryIndexResponseItem + mlserver.types.RepositoryLoadErrorResponse + mlserver.types.RepositoryUnloadErrorResponse + mlserver.types.RequestInput + mlserver.types.RequestOutput + mlserver.types.ResponseInput + mlserver.types.ResponseOutput + mlserver.types.State + mlserver.types.TensorData + diff --git a/docs-gb/index.md b/docs-gb/index.md new file mode 100644 index 000000000..6a3ea9d6e --- /dev/null +++ b/docs-gb/index.md @@ -0,0 +1,7 @@ +API Documentation +================= + +.. toctree:: + :maxdepth: 2 + + api/index diff --git a/docs-gb/reference/README.md b/docs-gb/reference/README.md deleted file mode 100644 index 02577ad8e..000000000 --- a/docs-gb/reference/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Reference - diff --git a/docs-gb/reference/api/codecs.md b/docs-gb/reference/api/codecs.md deleted file mode 100644 index 53e876a57..000000000 --- a/docs-gb/reference/api/codecs.md +++ /dev/null @@ -1,33 +0,0 @@ -# Codecs - -Codecs are used to encapsulate the logic required to encode / decode payloads -following the [Open Inference -Protocol](https://docs.seldon.io/projects/seldon-core/en/latest/reference/apis/v2-protocol.html) -into high-level Python types. -You can read more about the high-level concepts behind codecs in the -[](../../user-guide/content-type) section of the docs, as well as how to use -them. - -## Base Codecs - -All the codecs within MLServer extend from either the {class}`InputCodec ` -or the {class}`RequestCodec ` base classes. -These define the interface to deal with input (outputs) and request (responses) -respectively. - -```{eval-rst} -.. automodule:: mlserver.codecs - :members: InputCodec, RequestCodec -``` - -## Built-in Codecs - -The `mlserver` package will include a set of built-in codecs to cover common -conversions. -You can learn more about these in the [](../../user-guide/content-type.md#available-content-types) section of -the docs. - -```{eval-rst} -.. automodule:: mlserver.codecs - :members: NumpyCodec, NumpyRequestCodec, StringCodec, StringRequestCodec, Base64Codec, DatetimeCodec, PandasCodec -``` diff --git a/docs-gb/reference/api/index.md b/docs-gb/reference/api/index.md deleted file mode 100644 index 3229feba9..000000000 --- a/docs-gb/reference/api/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# Python API - -MLServer can be installed as a Python package, which exposes a public -framework which can be used to build [custom inference -runtimes](../../user-guide/custom) and [codecs](../../user-guide/content-type). - -Below, you can find the main reference for the Python API exposed by the -MLServer framework. - -```{toctree} -:titlesonly: - -./model.md -./types.md -./codecs.md -./metrics.md -``` diff --git a/docs-gb/reference/api/metrics.md b/docs-gb/reference/api/metrics.md deleted file mode 100644 index f82edd24e..000000000 --- a/docs-gb/reference/api/metrics.md +++ /dev/null @@ -1,13 +0,0 @@ -# Metrics - -The MLServer package exposes a set of methods that let you register and track -custom metrics. -This can be used within your own [custom inference -runtimes](../../user-guide/custom). -To learn more about how to expose custom metrics, check out the [metrics usage -guide](../../user-guide/metrics). - -```{eval-rst} -.. automodule:: mlserver - :members: register, log -``` diff --git a/docs-gb/reference/api/model.md b/docs-gb/reference/api/model.md deleted file mode 100644 index 0fe340ffc..000000000 --- a/docs-gb/reference/api/model.md +++ /dev/null @@ -1,22 +0,0 @@ -# MLModel - -The `MLModel` class is the base class for all [custom inference -runtimes](../../user-guide/custom). -It exposes the main interface that MLServer will use to interact with ML -models. - -The bulk of its public interface are the {func}`load() -`, {func}`unload() ` and -{func}`predict() ` methods. -However, it also contains helpers with encoding / decoding of requests and -responses, as well as properties to access the most common bits of the model's -metadata. - -When writing [custom runtimes](../../user-guide/custom), **this class should be -extended to implement your own load and predict logic**. - -```{eval-rst} -.. autoclass:: mlserver.MLModel - :members: - :member-order: bysource -``` diff --git a/docs-gb/reference/api/types.md b/docs-gb/reference/api/types.md deleted file mode 100644 index c8d1dab92..000000000 --- a/docs-gb/reference/api/types.md +++ /dev/null @@ -1,6 +0,0 @@ -# Types - -```{eval-rst} -.. automodule:: mlserver.types - :members: -``` diff --git a/docs-gb/reference/cli.md b/docs-gb/reference/cli.md deleted file mode 100644 index cb56a8bd3..000000000 --- a/docs-gb/reference/cli.md +++ /dev/null @@ -1,19 +0,0 @@ -# MLServer CLI - -The MLServer package includes a `mlserver` CLI designed to help with some of -the common tasks involved with a model's lifecycle. -Below, you can find the full list of supported subcommands. -Note that you can also get a similar high-level outline at any time by running: - -```bash -mlserver --help -``` - -## Commands - -```{eval-rst} - -.. click:: mlserver.cli.main:root - :prog: mlserver - :nested: full -``` diff --git a/docs-gb/reference/model-settings.md b/docs-gb/reference/model-settings.md deleted file mode 100644 index 7d1998108..000000000 --- a/docs-gb/reference/model-settings.md +++ /dev/null @@ -1,29 +0,0 @@ -# Model Settings - -In MLServer, each loaded model can be configured separately. -This configuration will include model information (e.g. metadata about the -accepted inputs), but also model-specific settings (e.g. number of [parallel -workers](../user-guide/parallel-inference) to run inference). - -This configuration will usually be provided through a `model-settings.json` -file which **sits next to the model artifacts**. -However, it's also possible to provide this through environment variables -prefixed with `MLSERVER_MODEL_` (e.g. `MLSERVER_MODEL_IMPLEMENTATION`). Note -that, in the latter case, this environment variables will be shared across all -loaded models (unless they get overriden by a `model-settings.json` file). -Additionally, if no `model-settings.json` file is found, MLServer will also try -to load a _"default"_ model from these environment variables. - -## Settings - -```{eval-rst} - -.. autopydantic_settings:: mlserver.settings.ModelSettings -``` - -## Extra Model Parameters - -```{eval-rst} - -.. autopydantic_settings:: mlserver.settings.ModelParameters -``` diff --git a/docs-gb/reference/python-api/README.md b/docs-gb/reference/python-api/README.md deleted file mode 100644 index c9f57933d..000000000 --- a/docs-gb/reference/python-api/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Python API - diff --git a/docs-gb/reference/settings.md b/docs-gb/reference/settings.md deleted file mode 100644 index ca282a53d..000000000 --- a/docs-gb/reference/settings.md +++ /dev/null @@ -1,15 +0,0 @@ -# MLServer Settings - -MLServer can be configured through a `settings.json` file on the root folder -from where MLServer is started. -Note that these are server-wide settings (e.g. gRPC or HTTP port) which are -separate from the [invidual model settings](./model-settings). -Alternatively, this configuration can also be passed through **environment -variables** prefixed with `MLSERVER_` (e.g. `MLSERVER_GRPC_PORT`). - -## Settings - -```{eval-rst} - -.. autopydantic_settings:: mlserver.settings.Settings -```