fix: whisper model billing

- Refactor model name handling across multiple controllers to improve clarity and maintainability.
- Enhance error logging and handling for better debugging and request processing robustness.
- Update pricing models in accordance with new calculations, ensuring accuracy in the billing logic.
This commit is contained in:
Laisky.Cai
2025-01-26 08:02:55 +00:00
parent f1db73405e
commit 5e351bc02a
6 changed files with 28 additions and 21 deletions

View File

@@ -135,17 +135,6 @@ func postConsumeQuota(ctx context.Context, usage *relaymodel.Usage, meta *meta.M
return quota
}
func getMappedModelName(modelName string, mapping map[string]string) (string, bool) {
if mapping == nil {
return modelName, false
}
mappedModelName := mapping[modelName]
if mappedModelName != "" {
return mappedModelName, true
}
return modelName, false
}
func isErrorHappened(meta *meta.Meta, resp *http.Response) bool {
if resp == nil {
if meta.ChannelType == channeltype.AwsClaude {