"""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 typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict


CompletionsResultObject = Literal["text_completion"]
r"""The object type, which is always set to `text_completion`."""


class CompletionsResultTypedDict(TypedDict):
    r"""Successfully generated completions."""

    id: NotRequired[str]
    r"""A unique ID of the completion."""
    object: NotRequired[CompletionsResultObject]
    r"""The object type, which is always set to `text_completion`."""
    choices: NotRequired[List[CompletionsChoiceTypedDict]]
    usage: NotRequired[UsageTypedDict]


class CompletionsResult(BaseModel):
    r"""Successfully generated completions."""

    id: Optional[str] = None
    r"""A unique ID of the completion."""

    object: Optional[CompletionsResultObject] = None
    r"""The object type, which is always set to `text_completion`."""

    choices: Optional[List[CompletionsChoice]] = None

    usage: Optional[Usage] = None
