docarray.array.mixins.pydantic module#

class docarray.array.mixins.pydantic.PydanticMixin[source]#

Bases: object

classmethod get_json_schema(indent=2)[source]#

Return a JSON Schema of DocumentArray class.

Return type:

str

to_pydantic_model()[source]#

Convert a DocumentArray object into a Pydantic model.

Return type:

List[PydanticDocument]

classmethod from_pydantic_model(model)[source]#

Convert a list of PydanticDocument into DocumentArray

Parameters:

model (List[BaseModel]) – the list of pydantic data model objects that represents a DocumentArray

Return type:

T

Returns:

a DocumentArray