nat.atif.content#

Content models for multimodal ATIF trajectories (ATIF v1.6+).

Classes#

ImageSource

Image source specification for images stored as files or at remote URLs.

ContentPart

A single content part within a multimodal message.

Module Contents#

class ImageSource(/, **data: Any)#

Bases: pydantic.BaseModel

Image source specification for images stored as files or at remote URLs.

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.

media_type: Literal['image/jpeg', 'image/png', 'image/gif', 'image/webp'] = None#
path: str = None#
model_config#

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

class ContentPart(/, **data: Any)#

Bases: pydantic.BaseModel

A single content part within a multimodal message.

Used when a message or observation contains mixed content types (text and images). For text-only content, a plain string can still be used instead of a ContentPart array.

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.

type: Literal['text', 'image'] = None#
text: str | None = None#
source: ImageSource | None = None#
model_config#

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

validate_content_type() ContentPart#

Validate that the correct fields are present for each content type.