from __future__ import annotations

from dataclasses import dataclass
from typing import Any

from app.generation.llm_client import (
    ChatCompletionResult,
    LLMAuthError,
    LLMClientError,
    LLMInvalidModelError,
    LLMMalformedOutputError,
    LLMRateLimitError,
    LLMTimeoutError,
    ModelInfo,
    ToolCallResult,
    ToolCompletionResult,
)

__all__ = [
    "ChatCompletionResult",
    "ChatMessage",
    "LLMAuthError",
    "LLMClientError",
    "LLMInvalidModelError",
    "LLMMalformedOutputError",
    "LLMRateLimitError",
    "LLMTimeoutError",
    "ModelInfo",
    "ToolCallResult",
    "ToolCompletionResult",
    "ToolSpec",
]


@dataclass(frozen=True)
class ToolSpec:
    """Provider-neutral tool definition."""

    name: str
    description: str
    parameters: dict[str, Any]


@dataclass(frozen=True)
class ChatMessage:
    role: str
    content: str | None = None
