"""The `Thought` content class and its streaming chunks.

The `Thought` is an interpretable / readable summary of the models' reasoning
process. This may be a summary generated by a summarizer model that is distinct from
the reasoning model, or for some models it may be the raw output of the model's thinking
process.
"""

from dataclasses import dataclass
from typing import Literal


@dataclass(kw_only=True)
class Thought:
    """Thinking content for a message.

    Represents the thinking or thought process of the assistant. These generally are
    summaries of the model's reasoning process, rather than the direct reasoning tokens,
    although this behavior is model and provider specific.
    """

    type: Literal["thought"] = "thought"

    thought: str
    """The thoughts or reasoning of the assistant."""


@dataclass(kw_only=True)
class ThoughtStartChunk:
    """Represents the start of a thought chunk stream."""

    type: Literal["thought_start_chunk"] = "thought_start_chunk"

    content_type: Literal["thought"] = "thought"
    """The type of content reconstructed by this chunk."""


@dataclass(kw_only=True)
class ThoughtChunk:
    """Represents an incremental thought chunk in a stream."""

    type: Literal["thought_chunk"] = "thought_chunk"

    content_type: Literal["thought"] = "thought"
    """The type of content reconstructed by this chunk."""

    delta: str
    """The incremental thoughts added in this chunk."""


@dataclass(kw_only=True)
class ThoughtEndChunk:
    """Represents the end of a thought chunk stream."""

    type: Literal["thought_end_chunk"] = "thought_end_chunk"

    content_type: Literal["thought"] = "thought"
    """The type of content reconstructed by this chunk."""
