antimatter.datatype.infer#

Module Contents#

Functions#

infer_datatype(→ antimatter.datatype.datatypes.Datatype)

Convenience handler for inferring the Datatype from an instance of a data

Attributes#

antimatter.datatype.infer.DICT_LIST_FMT_ERROR = 'data in a list format must contain dictionaries'#
antimatter.datatype.infer.infer_datatype(data: Any) antimatter.datatype.datatypes.Datatype#

Convenience handler for inferring the Datatype from an instance of a data object. Supported data types include string value, dictionary, list of dictionaries, pandas DataFrame, pytorch DataLoader, and langchain Retriever

Parameters:

data – Instance of a data object to get the Datatype for.

Returns:

The Datatype whose handler can work with the provided data instance.