# This file was auto-generated by Fern from our API Definition.

from ...core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class PromptsBatchPredictionsRequestResultsItem(UniversalBaseModel):
    task_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Task ID to associate the prediction with
    """

    output: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Prediction output that contains keys from labeling config. Each key must be a valid control tag name from the labeling config. For example, given the output: ```json {"sentiment": "positive"} ``` it will be converted to the internal LS annotation format: ```json {
      "value": {
        "choices": ["positive"]
      },
      "from_name": "label",
      "to_name": "",
      ...
    } ```
    """

    prompt_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of tokens in the prompt
    """

    completion_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of tokens in the completion
    """

    prompt_cost_usd: typing.Optional[float] = pydantic.Field(default=None)
    """
    Cost of the prompt (in USD)
    """

    completion_cost_usd: typing.Optional[float] = pydantic.Field(default=None)
    """
    Cost of the completion (in USD)
    """

    total_cost_usd: typing.Optional[float] = pydantic.Field(default=None)
    """
    Total cost of the inference (in USD)
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
