ContentDelta (ai/events.py)

dbt-charts · src/dbt_charts/ai/events.py · python · Apache-2.0
ai

Typed event protocol for the terminal agent loop.

# Source: https://github.com/dbt-labs/dbt-charts | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Typed event protocol for the terminal agent loop."""

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Literal

from dbt_charts.ai.failures import AITurnFailure

# -- Stream events (yielded by LLM provider adapters) -----------------------


@dataclass(slots=True)
class ContentDelta:
    """Incremental text chunk from the model."""

    delta: str


@dataclass(slots=True)
class ThinkingStatus:
    """Reasoning/thinking status from the model.

    ``status`` restates the whole summary so far, not an increment, so a
    consumer that appends

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key