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

from __future__ import annotations
from friendli.core.types import BaseModel
from friendli.core.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal
from typing_extensions import Annotated, TypedDict


class ResponseFormatRegexTypedDict(TypedDict):
    schema_: str
    "The schema of the output. Lookaheads or lookbehinds (e.g., `\\a`, `\\z`, `^`, `$`, `(?=)`, `(?!)`, `(?<=...)`, `(?<!...)`) are not supported. Group specials (e.g., `\\w`, `\\W`, `\\d`, `\\D`, `\\s`, `\\S`) do not support non-ASCII characters. Unicode escape patterns (e.g., `\\N`, `\\p`, `\\P`) are not supported. Additionally, conditional matching (`(?(`) and back-references can cause inefficiency."
    type: Literal["regex"]
    "The type of the response format: `regex`"


class ResponseFormatRegex(BaseModel):
    schema_: Annotated[str, pydantic.Field(alias="schema")]
    "The schema of the output. Lookaheads or lookbehinds (e.g., `\\a`, `\\z`, `^`, `$`, `(?=)`, `(?!)`, `(?<=...)`, `(?<!...)`) are not supported. Group specials (e.g., `\\w`, `\\W`, `\\d`, `\\D`, `\\s`, `\\S`) do not support non-ASCII characters. Unicode escape patterns (e.g., `\\N`, `\\p`, `\\P`) are not supported. Additionally, conditional matching (`(?(`) and back-references can cause inefficiency."
    TYPE: Annotated[
        Annotated[Literal["regex"], AfterValidator(validate_const("regex"))],
        pydantic.Field(alias="type"),
    ] = "regex"
    "The type of the response format: `regex`"
