(model string, auth *Auth)
| 3027 | } |
| 3028 | |
| 3029 | func rewriteModelForAuth(model string, auth *Auth) string { |
| 3030 | if auth == nil || model == "" { |
| 3031 | return model |
| 3032 | } |
| 3033 | prefix := strings.TrimSpace(auth.Prefix) |
| 3034 | if prefix == "" { |
| 3035 | return model |
| 3036 | } |
| 3037 | needle := prefix + "/" |
| 3038 | if !strings.HasPrefix(model, needle) { |
| 3039 | return model |
| 3040 | } |
| 3041 | return strings.TrimPrefix(model, needle) |
| 3042 | } |
| 3043 | |
| 3044 | func (m *Manager) applyAPIKeyModelAlias(auth *Auth, requestedModel string) string { |
| 3045 | if m == nil || auth == nil { |
no outgoing calls
no test coverage detected