# 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 InferenceRunCostEstimate(UniversalBaseModel):
    prompt_cost_usd: typing.Optional[str] = pydantic.Field(default=None)
    """
    Cost of the prompt (in USD)
    """

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

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

    is_error: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether an error occurred or not
    """

    error_type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Type of error (e.g. "Timeout", "Rate Limit", etc)
    """

    error_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error message details
    """

    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
