feat: add Anthropic endpoints for Volcengine, AiHubMix, and Xiaomi MiMo#1521
Conversation
…es with UI checkbox support - Add bailian_anthropic (Anthropic format) at https://dashscope.aliyuncs.com/apps/anthropic - Add moonshot_coding (Kimi Coding endpoint) at https://api.kimi.com/coding - Both use anthropic/messages format with anthropic.PlatformDirect transformer - Implement checkbox UI pattern (like Gemini Vertex/Anthropic AWS) for Kimi Coding selection - Fix handleKimiCodingChange to properly update form.type and form.baseURL on toggle - Add English/Chinese i18n keys for new channel types and Kimi Coding checkbox - Update Ent schema, channel configs, provider mappings, and generated code Follows dual/triple-channel pattern used by Minimax, Moonshot, Doubao providers.
- Reset useKimiCoding on provider change, initialRow change, and dialog open/close - Merge TypeBailianAnthropic and TypeMoonshotCoding switch cases
…ix ContentSection import
- Change navigate({ to: '/dashboard' }) to navigate({ to: '/' })
- Dashboard is at root route, not /dashboard
- Fixes broken navigation when clicking '返回仪表盘' button
- Add missing ContentSection import in channel-success-rates page - Replace useMemo with useEffect for page reset side effect - Internationalize hardcoded Chinese labels (今天/本周/本月) - Replace <a> with Link component for SPA navigation in dashboard
The dist directory is gitignored but go:embed all:dist/* requires at least one file to compile. Add .gitkeep to fix CI build failures while keeping frontend artifacts untracked.
Greptile SummaryThis PR adds three new Anthropic-format channel types — Confidence Score: 4/5Safe to merge after verifying the volcengine_anthropic base URL path and confirming the web-search beta header behavior is acceptable for the three new providers Two previously raised P1 concerns in the changed files remain unaddressed: the suspicious /api/coding path for volcengine_anthropic (which would silently send requests to an incorrect endpoint), and the web-search beta header being injected into all three new PlatformDirect providers when native web-search tools are present. All other schema, enum, and frontend changes are mechanically correct. internal/server/biz/channel_llm.go (PlatformDirect beta header inheritance) and frontend/src/features/channels/data/config_channels.ts (volcengine_anthropic base URL path) Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ChannelService as channel_llm.go
participant Transformer as anthropic/outbound.go
participant Provider as Third-Party Provider
Client->>ChannelService: buildChannelWithTransformer(c)
Note over ChannelService: case TypeVolcengineAnthropic,<br/>TypeAihubmixAnthropic,<br/>TypeXiaomiAnthropic
ChannelService->>Transformer: NewOutboundTransformerWithConfig(PlatformDirect, baseURL)
Note over Transformer: NormalizeBaseURL(baseURL, "v1")<br/>e.g. aihubmix.com → aihubmix.com/v1
Transformer-->>ChannelService: OutboundTransformer
Client->>Transformer: TransformRequest(llmReq)
Note over Transformer: if containsNativeWebSearchTool<br/>AND PlatformDirect →<br/>inject Anthropic-Beta: web-search-2025-03-05
Transformer->>Provider: POST baseURL + /messages
Provider-->>Transformer: response
Transformer-->>Client: transformed response
Reviews (5): Last reviewed commit: "fix: use AiHubMix icon for aihubmix_anth..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces support for new Anthropic-compatible channel types (xiaomi_anthropic, volcengine_anthropic, and aihubmix_anthropic) across the frontend and backend. The review identified two issues: the aihubmix_anthropic channel should use the AiHubMix icon instead of the OpenAI icon for consistency, and the volcengine_anthropic channel should be handled using the specialized PlatformDoubao transformer rather than the generic PlatformDirect transformer to ensure proper Ark-specific logic.
使用与 provider 一致的 AiHubMix 图标,提升品牌识别度。
|
token usage 分为独立的 API 吧。 应该可以复用已有请求? |
|
token usage |
|
好的🆗 |
|
已拆分 |
Uh oh!
There was an error while loading. Please reload this page.