"""Client Claude (voir plan Phase 2, §2) — même politique que auth/send_email.py::EmailNotConfiguredError : une clé absente est une configuration incomplète, jamais un crash brut ni une clé en dur.""" import os import anthropic MODEL = "claude-sonnet-5" class AnthropicNotConfiguredError(Exception): """Levée quand ANTHROPIC_API_KEY est absente — voir .env.example. Le compte claude.ai Entreprise (chat en équipe) n'est PAS une clé API : il faut un compte Anthropic Console (console.anthropic.com) séparé.""" def get_client() -> anthropic.Anthropic: api_key = os.environ.get("ANTHROPIC_API_KEY") if not api_key: raise AnthropicNotConfiguredError("ANTHROPIC_API_KEY absente") return anthropic.Anthropic(api_key=api_key)