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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.unchecked_base_model import UncheckedBaseModel
from .start_agents_request_properties_mllm_vendor import StartAgentsRequestPropertiesMllmVendor


class StartAgentsRequestPropertiesMllm(UncheckedBaseModel):
    """
    Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. MLLM is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline.
    """

    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    The MLLM WebSocket URL for real-time communication.
    """

    api_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    The API key used for MLLM authentication.
    """

    messages: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
    """
    Array of conversation items used for short-term memory management. Uses the same structure as `item.content` from the OpenAI Realtime API.
    """

    params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Additional MLLM configuration parameters. The `modalities` setting is overridden by `input_modalities` and `output_modalities`. The `turn_detection` setting is overridden by the `turn_detection` section outside of `mllm`.
    """

    input_modalities: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    MLLM input modalities:
    - `["audio"]`: Audio only
    - `["audio", "text"]`: Audio plus text
    """

    output_modalities: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    MLLM output modalities:
    - `["text", "audio"]`: Text plus audio
    """

    greeting_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Agent greeting message. If provided, the first user in the channel is automatically greeted with this message upon joining.
    """

    vendor: typing.Optional[StartAgentsRequestPropertiesMllmVendor] = pydantic.Field(default=None)
    """
    MLLM provider. Currently supports:
    - `openai`: OpenAI Realtime API
    - `vertexai`: Use this for Google Gemini Live
    """

    style: typing.Optional[typing.Literal["openai"]] = pydantic.Field(default=None)
    """
    The request style for MLLM completion:
    - `openai`: For OpenAI Realtime API format
    """

    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
