MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / rewriteModelForAuth

Function rewriteModelForAuth

sdk/cliproxy/auth/conductor.go:3029–3042  ·  view source on GitHub ↗
(model string, auth *Auth)

Source from the content-addressed store, hash-verified

3027}
3028
3029func 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
3044func (m *Manager) applyAPIKeyModelAlias(auth *Auth, requestedModel string) string {
3045 if m == nil || auth == nil {

Calls

no outgoing calls

Tested by

no test coverage detected