mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-26 07:25:20 +00:00
feat: support Claude Sonnet 5.5
This commit is contained in:
1 parent
9a62841fd1
commit
8490a81867
40 files changed
+855
-117
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user