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

from __future__ import annotations
from .completionschoice import CompletionsChoice, CompletionsChoiceTypedDict
from .usage import Usage, UsageTypedDict
from friendli.types import BaseModel
from friendli.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import List, Literal
from typing_extensions import Annotated, TypedDict


class ServerlessCompletionsSuccessTypedDict(TypedDict):
    choices: List[CompletionsChoiceTypedDict]
    id: str
    r"""A unique ID of the completion."""
    usage: UsageTypedDict
    object: Literal["text_completion"]
    r"""The object type, which is always set to `text_completion`."""


class ServerlessCompletionsSuccess(BaseModel):
    choices: List[CompletionsChoice]

    id: str
    r"""A unique ID of the completion."""

    usage: Usage

    OBJECT: Annotated[
        Annotated[
            Literal["text_completion"],
            AfterValidator(validate_const("text_completion")),
        ],
        pydantic.Field(alias="object"),
    ] = "text_completion"
    r"""The object type, which is always set to `text_completion`."""
