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

from __future__ import annotations

from typing import Literal

import pydantic
from pydantic.functional_validators import AfterValidator
from typing_extensions import Annotated, TypedDict

from friendli.types import BaseModel
from friendli.utils import validate_const

from .responseformatjsonschemaschema import (
    ResponseFormatJSONSchemaSchema,
    ResponseFormatJSONSchemaSchemaTypedDict,
)


class ResponseFormatJSONSchemaTypedDict(TypedDict):
    json_schema: ResponseFormatJSONSchemaSchemaTypedDict
    type: Literal["json_schema"]
    r"""The type of the response format: `json_schema`"""


class ResponseFormatJSONSchema(BaseModel):
    json_schema: ResponseFormatJSONSchemaSchema

    TYPE: Annotated[
        Annotated[
            Literal["json_schema"], AfterValidator(validate_const("json_schema"))
        ],
        pydantic.Field(alias="type"),
    ] = "json_schema"
    r"""The type of the response format: `json_schema`"""
