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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .thought_scenario import ThoughtScenario
from .thought_type import ThoughtType


class Thought(UniversalBaseModel):
    thought_id: str
    task_id: str
    organization_id: str
    workflow_run_id: typing.Optional[str] = None
    workflow_run_block_id: typing.Optional[str] = None
    workflow_id: typing.Optional[str] = None
    workflow_permanent_id: typing.Optional[str] = None
    user_input: typing.Optional[str] = None
    observation: typing.Optional[str] = None
    thought: typing.Optional[str] = None
    answer: typing.Optional[str] = None
    thought_type: typing.Optional[ThoughtType] = None
    thought_scenario: typing.Optional[ThoughtScenario] = None
    output: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
    input_token_count: typing.Optional[int] = None
    output_token_count: typing.Optional[int] = None
    reasoning_token_count: typing.Optional[int] = None
    cached_token_count: typing.Optional[int] = None
    thought_cost: typing.Optional[float] = None
    created_at: dt.datetime
    modified_at: dt.datetime

    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
