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:
hughhuangandClaude Opus 4.6 committed 2026-02-20 11:22:08 +08:00
1 parent e76a85db97
commit 2d301370e2
5 files changed
+236 -70

No files matched your search

+7
View File
@@ -184,10 +184,17 @@ export interface TrendAnalysisDatabase {
analyses: TrendAnalysisRecord[];
}
/**
* LLM 提供商类型
*/
export type LLMProvider = 'openai' | 'anthropic';
/**
* LLM 配置
*/
export interface LLMConfig {
/** API 提供商类型,默认 openai */
provider?: LLMProvider;
/** API 基础 URL */
apiBase: string;
/** API 密钥 */