"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.components import providername as components_providername
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import (
    FieldMetadata,
    PathParamMetadata,
    QueryParamMetadata,
    SecurityMetadata,
    validate_open_enum,
)
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


class GetParametersSecurityTypedDict(TypedDict):
    bearer: str


class GetParametersSecurity(BaseModel):
    bearer: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="http",
                sub_type="bearer",
                field_name="Authorization",
            )
        ),
    ]


class GetParametersRequestTypedDict(TypedDict):
    author: str
    slug: str
    provider: NotRequired[components_providername.ProviderName]


class GetParametersRequest(BaseModel):
    author: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    slug: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    provider: Annotated[
        Annotated[
            Optional[components_providername.ProviderName],
            PlainValidator(validate_open_enum(False)),
        ],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None


SupportedParameter = Union[
    Literal[
        "temperature",
        "top_p",
        "top_k",
        "min_p",
        "top_a",
        "frequency_penalty",
        "presence_penalty",
        "repetition_penalty",
        "max_tokens",
        "logit_bias",
        "logprobs",
        "top_logprobs",
        "seed",
        "response_format",
        "structured_outputs",
        "stop",
        "tools",
        "tool_choice",
        "parallel_tool_calls",
        "include_reasoning",
        "reasoning",
        "reasoning_effort",
        "web_search_options",
        "verbosity",
    ],
    UnrecognizedStr,
]


class GetParametersDataTypedDict(TypedDict):
    r"""Parameter analytics data"""

    model: str
    r"""Model identifier"""
    supported_parameters: List[SupportedParameter]
    r"""List of parameters supported by this model"""


class GetParametersData(BaseModel):
    r"""Parameter analytics data"""

    model: str
    r"""Model identifier"""

    supported_parameters: List[
        Annotated[SupportedParameter, PlainValidator(validate_open_enum(False))]
    ]
    r"""List of parameters supported by this model"""


class GetParametersResponseTypedDict(TypedDict):
    r"""Returns the parameters for the specified model"""

    data: GetParametersDataTypedDict
    r"""Parameter analytics data"""


class GetParametersResponse(BaseModel):
    r"""Returns the parameters for the specified model"""

    data: GetParametersData
    r"""Parameter analytics data"""
