feat: 支持 Anthropic Messages API 格式调用
通过 LLM_PROVIDER 环境变量区分 openai 和 anthropic 两种调用方式, LLMClient 根据 provider 分发到不同的 API 调用路径。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
e76a85db97
commit
2d301370e2
5 files changed
+236
-70
No files matched your search
@@ -16,6 +16,10 @@ SILVER_BASELINE_THRESHOLD=0.2
|
||||
GOLD_BASELINE_THRESHOLD=5
|
||||
|
||||
# LLM API 配置(用于趋势分析功能)
|
||||
# LLM 提供商类型:openai(默认)或 anthropic
|
||||
# LLM_PROVIDER=openai
|
||||
|
||||
# === OpenAI 兼容 API 配置 ===
|
||||
# LLM API 基础 URL(可选,默认 OpenAI API)
|
||||
# LLM_API_BASE=https://api.openai.com/v1
|
||||
# LLM API 密钥(必需,如果未配置则跳过趋势分析功能)
|
||||
@@ -23,5 +27,10 @@ GOLD_BASELINE_THRESHOLD=5
|
||||
# LLM 模型(可选,默认 gpt-4o-mini)
|
||||
# LLM_MODEL=gpt-4o-mini
|
||||
|
||||
# === Anthropic API 配置(用于测试脚本 test-anthropic-llm.ts) ===
|
||||
# ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxx
|
||||
# ANTHROPIC_MODEL=claude-sonnet-4-20250514
|
||||
# ANTHROPIC_API_BASE=https://api.anthropic.com
|
||||
|
||||
# 趋势分析间隔(毫秒),默认 300000(5 分钟)
|
||||
# TREND_ANALYSIS_INTERVAL=300000
|
||||
Reference in new issue
Block a user