bibraeval.Record

class bibraeval.Record(*, doc_id, metadata)

Bases: BaseModel, Generic

A record with a stable document identifier and validated metadata.

metadata is parsed with the caller-supplied Pydantic model; doc_id is kept separately so records can be matched independently of row order.

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:
  • doc_id (str)

  • metadata (MetadataT)

doc_id: str
metadata: MetadataT
classmethod from_payload(doc_id, payload, schema)

Validate a metadata payload and create a record for doc_id.

Parameters:
  • doc_id (str) – Stable identifier used to match this record across datasets.

  • payload (dict[str, Any]) – Metadata fields accepted by schema.

  • schema (type[MetadataT]) – Pydantic model used to validate the metadata.

Return type:

Record[TypeVar]

model_config = {}

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