(auth *Auth, routeModel string)
| 1113 | } |
| 1114 | |
| 1115 | func (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 | |
| 1137 | func (m *Manager) selectionModelForAuth(auth *Auth, routeModel string) string { |
| 1138 | requestedModel := rewriteModelForAuth(routeModel, auth) |
no test coverage detected