Fix: CompletionRatio is not working for openrouter.ai

https://openrouter.ai/docs#models
Model name of openrouter is prefix with company name, e.g. "model": "anthropic/claude-3-opus:beta", therefore, CompletionRatio will not working for it which is only work for prefix with claude-xxx
This commit is contained in:
h1xy 2024-04-08 02:12:47 +08:00 committed by GitHub
parent a7cfce24d0
commit c5f6d0e063
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -206,11 +206,11 @@ func GetCompletionRatio(name string) float64 {
} }
return 2 return 2
} }
if strings.HasPrefix(name, "claude-instant-1") { if strings.Contains(name, "claude-instant-1") {
return 3 return 3
} else if strings.HasPrefix(name, "claude-2") { } else if strings.Contains(name, "claude-2") {
return 3 return 3
} else if strings.HasPrefix(name, "claude-3") { } else if strings.Contains(name, "claude-3") {
return 5 return 5
} }
if strings.HasPrefix(name, "mistral-") { if strings.HasPrefix(name, "mistral-") {