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

from __future__ import annotations

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .anthropic_think_provider_model import AnthropicThinkProviderModel
from .aws_bedrock_think_provider_credentials import AwsBedrockThinkProviderCredentials
from .aws_bedrock_think_provider_model import AwsBedrockThinkProviderModel
from .google_think_provider_model import GoogleThinkProviderModel
from .open_ai_think_provider_model import OpenAiThinkProviderModel


class ThinkSettingsV1Provider_OpenAi(UniversalBaseModel):
    type: typing.Literal["open_ai"] = "open_ai"
    version: typing.Optional[typing.Literal["v1"]] = None
    model: OpenAiThinkProviderModel
    temperature: typing.Optional[float] = None

    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


class ThinkSettingsV1Provider_AwsBedrock(UniversalBaseModel):
    type: typing.Literal["aws_bedrock"] = "aws_bedrock"
    model: AwsBedrockThinkProviderModel
    temperature: typing.Optional[float] = None
    credentials: typing.Optional[AwsBedrockThinkProviderCredentials] = None

    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


class ThinkSettingsV1Provider_Anthropic(UniversalBaseModel):
    type: typing.Literal["anthropic"] = "anthropic"
    version: typing.Optional[typing.Literal["v1"]] = None
    model: AnthropicThinkProviderModel
    temperature: typing.Optional[float] = None

    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


class ThinkSettingsV1Provider_Google(UniversalBaseModel):
    type: typing.Literal["google"] = "google"
    version: typing.Optional[typing.Literal["v1beta"]] = None
    model: GoogleThinkProviderModel
    temperature: typing.Optional[float] = None

    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


class ThinkSettingsV1Provider_Groq(UniversalBaseModel):
    type: typing.Literal["groq"] = "groq"
    version: typing.Optional[typing.Literal["v1"]] = None
    model: typing.Literal["openai/gpt-oss-20b"] = "openai/gpt-oss-20b"
    temperature: typing.Optional[float] = None

    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


ThinkSettingsV1Provider = typing_extensions.Annotated[
    typing.Union[
        ThinkSettingsV1Provider_OpenAi,
        ThinkSettingsV1Provider_AwsBedrock,
        ThinkSettingsV1Provider_Anthropic,
        ThinkSettingsV1Provider_Google,
        ThinkSettingsV1Provider_Groq,
    ],
    pydantic.Field(discriminator="type"),
]
