llm/providers.py

projectBEA · src/modules/llm/providers.py · python · MIT
ai, AI / Agents

Every provider as data: which transport it speaks and where it lives. Adding a provider that speaks one of the three protocols is one entry here — no subclass, no branch anywhere else. The factory reads this table; the doctor and the wizard read it too, so the three never drift a

# Source: https://github.com/emqnuele/projectBEA | License: MIT | Copyright 2026 Emanuele Faraci
# Provided via justclaw.it.com; keep this notice with the code.
"""Every provider as data: which transport it speaks and where it lives.

Adding a provider that speaks one of the three protocols is one entry here —
no subclass, no branch anywhere else. The factory reads this table; the doctor
and the wizard read it too, so the three never drift apart.
"""

from dataclasses import dataclass
from typing import Dict, Optional

RESPONSES = "responses"
CHAT = "chat"
ANTHROPIC = "anthropic"

TRANSPORTS = (RESPONSES, CHAT, ANTHROPIC)


@dataclass(frozen=True)
class Provider:
    """One row per provider id.

    `base_url` is fixed for first-party endpoints and empty for brought-your-
    own ones, whe

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

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

Get a free API key