feat: support Claude Sonnet 5.5

This commit is contained in:
haruka committed 2026-09-29 04:55:07 +08:00
1 parent 9a62841fd1
commit 8490a81867
40 files changed
+855 -117

No files matched your search

+10 -4
View File
@@ -95,11 +95,17 @@ func (s *GatewayService) Forward(ctx context.Context, c *gin.Context, account *A
}
// API-key mappings and OAuth native IDs are resolved before mimicry.
validationModel := parsed.Model
if account != nil && account.Type == AccountTypeAPIKey {
validationModel = account.GetMappedModel(validationModel)
if account != nil {
if account.IsBedrock() {
if resolved, ok := ResolveBedrockModelID(account, validationModel); ok {
validationModel = resolved
}
} else if account.Type == AccountTypeAPIKey {
validationModel = account.GetMappedModel(validationModel)
}
}
if account != nil && account.Platform == PlatformAnthropic && !account.IsBedrock() && account.Type != AccountTypeServiceAccount {
if err := validateClaudeOpus55Request(parsed.Body.Bytes(), validationModel); err != nil {
if account != nil && account.Platform == PlatformAnthropic {
if err := validateClaude55Request(parsed.Body.Bytes(), validationModel); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"type": "error", "error": gin.H{"type": "invalid_request_error", "message": err.Error()}})
return nil, err
}