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

from __future__ import annotations

from typing import List

from typing_extensions import TypedDict

from friendli.types import BaseModel


class TopLogprobsTypedDict(TypedDict):
    pass


class TopLogprobs(BaseModel):
    pass


class CompletionsLogprobsTypedDict(TypedDict):
    text_offset: List[int]
    r"""The starting character position of each token in the generated text, useful for mapping tokens back to their exact location for detailed analysis."""
    token_logprobs: List[float]
    r"""The log probabilities of each generated token, indicating the model's confidence in selecting each token."""
    tokens: List[str]
    r"""A list of individual tokens generated in the completion, representing segments of text such as words or pieces of words."""
    top_logprobs: List[TopLogprobsTypedDict]
    r"""A list of dictionaries, where each dictionary represents the top alternative tokens considered by the model at a specific position in the generated text, along with their log probabilities. The number of items in each dictionary matches the value of `logprobs`."""


class CompletionsLogprobs(BaseModel):
    text_offset: List[int]
    r"""The starting character position of each token in the generated text, useful for mapping tokens back to their exact location for detailed analysis."""

    token_logprobs: List[float]
    r"""The log probabilities of each generated token, indicating the model's confidence in selecting each token."""

    tokens: List[str]
    r"""A list of individual tokens generated in the completion, representing segments of text such as words or pieces of words."""

    top_logprobs: List[TopLogprobs]
    r"""A list of dictionaries, where each dictionary represents the top alternative tokens considered by the model at a specific position in the generated text, along with their log probabilities. The number of items in each dictionary matches the value of `logprobs`."""
