feat: add anthropic-compatible provider type

Add a new provider type "anthropic-compatible" to support Anthropic API
variants that use array format for the system field instead of string.

Changes:
- Add AnthropicCompatible to ApiProviderType enum (backend)
- Add AnthropicCompatible to Agent ProviderType enum
- Modify AnthropicProtocol to support array system format
- Add provider type selector in ProviderConfigForm for custom providers
- Update icon mappings to show Claude icon for anthropic-compatible
- Update model registry mappings to show Anthropic models

This allows users to connect to Anthropic-compatible proxies (like One API)
that expect the system field in array format:
  {"system": [{"type": "text", "text": "..."}]}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
coso
2026-01-12 20:06:08 +08:00
co-authored by Claude Opus 4.5
parent 2b32211e85
commit 86e2a0db33
18 changed files with 184 additions and 25 deletions
+9 -8
View File
@@ -703,14 +703,15 @@ mod unit_tests {
&ctx.db,
&provider.id,
Some("Updated Name".to_string()),
None,
Some(false),
None,
None,
None,
None,
None,
None,
None, // provider_type
None, // api_host
Some(false), // enabled
None, // sort_order
None, // api_version
None, // project
None, // location
None, // region
None, // custom_models
)
.expect("Failed to update provider");