# 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 .music_prompt import MusicPrompt


class BodyComposeMusicWithADetailedResponseV1MusicDetailedPost(UncheckedBaseModel):
    prompt: typing.Optional[str] = pydantic.Field(default=None)
    """
    A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
    """

    music_prompt: typing.Optional[MusicPrompt] = pydantic.Field(default=None)
    """
    A music prompt. Deprecated. Use `composition_plan` instead.
    """

    composition_plan: typing.Optional[MusicPrompt] = pydantic.Field(default=None)
    """
    A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
    """

    music_length_ms: typing.Optional[int] = pydantic.Field(default=None)
    """
    The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 10000ms and 300000ms. Optional - if not provided, the model will choose a length based on the prompt.
    """

    model_id: typing.Optional[typing.Literal["music_v1"]] = pydantic.Field(default=None)
    """
    The model to use for the generation.
    """

    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
