resolveBackendWithAliases is like resolveUniversalLLMBackendFromModel but also recognises extra provider name prefixes before falling back to the standard lookup. extraAliases maps lowercased provider names (the prefix before the first "/") to the corresponding UniversalLLMBackend. This lets engines
(model string, extraAliases map[string]UniversalLLMBackend)
| 181 | // UniversalLLMBackend. This lets engines that expose their own provider naming (e.g. Pi's |
| 182 | // "github-copilot") reuse the shared backend resolution logic without special-casing. |
| 183 | func resolveBackendWithAliases(model string, extraAliases map[string]UniversalLLMBackend) (UniversalLLMBackend, error) { |
| 184 | if len(extraAliases) > 0 { |
| 185 | model = strings.TrimSpace(model) |
| 186 | parts := strings.SplitN(model, "/", 2) |
| 187 | if len(parts) == 2 { |
| 188 | provider := strings.ToLower(strings.TrimSpace(parts[0])) |
| 189 | if backend, ok := extraAliases[provider]; ok { |
| 190 | universalLLMConsumerLog.Printf("Resolved backend via alias %q → %s", provider, backend) |
| 191 | return backend, nil |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | return resolveUniversalLLMBackendFromModel(model) |
| 196 | } |
| 197 | |
| 198 | // UniversalCLIEngineExecutionConfig holds the engine-specific parameters for |
| 199 | // BuildCLIEngineExecutionSteps. Engines that share the same execution pattern |
no test coverage detected