Is your feature request related to a problem? Please describe.
In some scenarios users might want to dynamically create a class.
For example, in the search apps, data might be given through different sources, it might have a folder structure, and we are then responsible for converting it to a suitable docarray format, where this feature will come handy.
Describe the solution you'd like
Having a function that takes pairs of field names and their corresponding types and returns a class
Describe alternatives you've considered
Tried with Pydantic's create_model, and it works ok, but this doesn't return a BaseDocument so would be nice to have it handled inside docarray.
Is your feature request related to a problem? Please describe.
In some scenarios users might want to dynamically create a class.
For example, in the search apps, data might be given through different sources, it might have a folder structure, and we are then responsible for converting it to a suitable docarray format, where this feature will come handy.
Describe the solution you'd like
Having a function that takes pairs of field names and their corresponding types and returns a class
Describe alternatives you've considered
Tried with Pydantic's
create_model, and it works ok, but this doesn't return aBaseDocumentso would be nice to have it handled inside docarray.