feat: add Anthropic API provider support and missing env vars

- Add LLM_PROVIDER env var (openai/anthropic) to switch cloud backend
- Use ChatAnthropic for anthropic provider with custom base_url
- Add CONTEXT_MAX_TOKENS, CONTEXT_KEEP_RECENT, SESSIONS_DIR,
  HISTORY_MAX_SNAPSHOTS to .env and .env.example
- Add langchain-anthropic dependency to requirements.txt

Note: E2E testing blocked — the configured MiniMax API key
(sk-cp-...) returns 401 across all endpoints (Anthropic and OpenAI).
The API key may be expired or lack text-generation model access.
This commit is contained in:
2026-05-14 23:39:00 +08:00
parent d0f5d05316
commit 76f98a7aeb
3 changed files with 16 additions and 1 deletions
+3
View File
@@ -1,6 +1,9 @@
# 大语言模型后端:cloud 或 local
LLM_BACKEND=cloud
# 云端提供商:openai 或 anthropic
LLM_PROVIDER=openai
# 云端配置(OpenAI 兼容)
OPENAI_API_KEY=sk-xxxx
OPENAI_BASE_URL=https://api.openai.com/v1