from __future__ import annotations

from anthropic import (
    APIConnectionError as AnthropicConnectionError,
)
from anthropic import (
    APITimeoutError as AnthropicTimeoutError,
)
from anthropic import (
    InternalServerError as AnthropicServerError,
)
from anthropic import (
    RateLimitError as AnthropicRateLimitError,
)
from openai import (
    APIConnectionError as OpenAIConnectionError,
)
from openai import (
    APITimeoutError as OpenAITimeoutError,
)
from openai import (
    InternalServerError as OpenAIServerError,
)
from openai import (
    RateLimitError as OpenAIRateLimitError,
)

TRANSIENT_LLM_ERRORS: tuple[type[Exception], ...] = (
    AnthropicConnectionError,
    AnthropicTimeoutError,
    AnthropicServerError,
    AnthropicRateLimitError,
    OpenAIConnectionError,
    OpenAITimeoutError,
    OpenAIServerError,
    OpenAIRateLimitError,
)

ANTHROPIC_MAX_INPUT_TOKENS = 195_000
CHARS_PER_TOKEN_ESTIMATE = 4
