Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ OPENAI_API_KEY=

# Anthropic (used when LLM_PROVIDER=anthropic)
ANTHROPIC_API_KEY=
# ANTHROPIC_BASE_URL=https://your-proxy.example.com # optional; routes Anthropic API calls via a custom proxy
# LLM_MODEL=claude-opus-4-7 # optional override; default: claude-opus-4-7
# CHART_LLM_MODEL=claude-haiku-4-5

Expand Down
2 changes: 2 additions & 0 deletions backend/src/analytics_agent/agent/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def _make_anthropic(model: str, streaming: bool) -> BaseChatModel:
kwargs: dict = {"model_name": model, "streaming": streaming}
if settings.anthropic_api_key:
kwargs["api_key"] = SecretStr(settings.anthropic_api_key)
if settings.anthropic_base_url:
kwargs["anthropic_api_url"] = settings.anthropic_base_url
return ChatAnthropic(**kwargs) # type: ignore[call-arg]


Expand Down
1 change: 1 addition & 0 deletions backend/src/analytics_agent/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class Settings(BaseSettings):
llm_provider: str = "openai"
openai_api_key: str = ""
anthropic_api_key: str = ""
anthropic_base_url: str = ""
google_api_key: str = ""
# Bedrock — uses the standard AWS credential chain by default (env vars,
# ~/.aws/credentials, IAM role). Set the explicit *_key_id/*_access_key
Expand Down
Loading