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

Method executionModelCandidates

sdk/cliproxy/auth/conductor.go:1115–1135  ·  view source on GitHub ↗
(auth *Auth, routeModel string)

Source from the content-addressed store, hash-verified

1113}
1114
1115func (m *Manager) executionModelCandidates(auth *Auth, routeModel string) []string {
1116 if auth != nil && auth.Attributes != nil {
1117 if homeModel := strings.TrimSpace(auth.Attributes[homeUpstreamModelAttributeKey]); homeModel != "" {
1118 return []string{homeModel}
1119 }
1120 }
1121 requestedModel := rewriteModelForAuth(routeModel, auth)
1122 requestedModel = m.applyOAuthModelAlias(auth, requestedModel)
1123 if pool := m.resolveOpenAICompatUpstreamModelPool(auth, requestedModel); len(pool) > 0 {
1124 if len(pool) == 1 {
1125 return pool
1126 }
1127 offset := m.nextModelPoolOffset(openAICompatModelPoolKey(auth, requestedModel), len(pool))
1128 return rotateStrings(pool, offset)
1129 }
1130 resolved := m.applyAPIKeyModelAlias(auth, requestedModel)
1131 if strings.TrimSpace(resolved) == "" {
1132 resolved = requestedModel
1133 }
1134 return []string{resolved}
1135}
1136
1137func (m *Manager) selectionModelForAuth(auth *Auth, routeModel string) string {
1138 requestedModel := rewriteModelForAuth(routeModel, auth)

Callers 1

Calls 7

applyOAuthModelAliasMethod · 0.95
nextModelPoolOffsetMethod · 0.95
applyAPIKeyModelAliasMethod · 0.95
rewriteModelForAuthFunction · 0.85
openAICompatModelPoolKeyFunction · 0.85
rotateStringsFunction · 0.85

Tested by

no test coverage detected