feat: 支持多 API 格式 (OpenAI Responses + Anthropic Messages)#13
Merged
Conversation
将 AIProviderType 从 2 种扩展到 4 种 (openai, openai-responses, gemini, anthropic), 重构 callLLM/fetchProviderModels 为 switch 分支,统一 SettingsModal 的 provider 配置常量。
Sallyn0225
added a commit
that referenced
this pull request
Mar 3, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AIProviderType从 2 种扩展到 4 种:openai、openai-responses、gemini、anthropiccallLLM和fetchProviderModels为switch四分支,新增 OpenAI Responses API (/responses端点) 和 Anthropic Messages API (/v1/messages端点,x-api-key认证) 支持PROVIDER_DEFAULTS常量 map,统一管理各格式的 label、badge、默认 URL 和 API Key placeholder,消除散落的三元表达式新增 API 格式
openai-responses{baseUrl}/responsesanthropic{baseUrl}/v1/messagesx-api-key+anthropic-versionheader向后兼容
openai/gemini逻辑不变AIProvider接口结构未变,localStorage 已有数据无需迁移Test plan
npm run buildTypeScript 编译通过