# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .multi_input_media_source import MultiInputMediaSource


class MultiInputRequest(UniversalBaseModel):
    """
    This field is required if the `input_type` parameter is `multi_input`.
    """

    input_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    Text to combine with the images when generating the embedding.
    
    **Usage options**:
    - Omit this field to create an embedding from images only.
    - Provide plain text to add context. Example: "A person cooking."
    - Use image references to describe relationships between specific images. The format is `<@name>`, where `name` matches the `name` field of a media source. Example: "A person wearing <@outfit> and holding <@accessory>."
    """

    media_sources: typing.List[MultiInputMediaSource] = pydantic.Field()
    """
    An array of up to 10 images to include in the embedding. The platform processes images in the order they appear in the array. If you use image references in the [`input_text`](/v1.3/api-reference/create-embeddings-v2/create-embeddings#request.body.multi_input.input_text) parameter, each must have a corresponding image with a matching `name` field. If an image reference has no match, the request fails.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
