Compare commits
No commits in common. "5b2d33411e3a6319636ee01a3e6ea79f68be9f2d" and "d736d43f728711a7f3793d995bad73e73498377e" have entirely different histories.
5b2d33411e
...
d736d43f72
@ -344,33 +344,15 @@ function switchConfig(opts: SwitchOptions) {
|
||||
// Switch auxiliary tasks
|
||||
if (!config.auxiliary) config.auxiliary = {} as Record<string, AuxiliaryEntry>;
|
||||
|
||||
// Look up provider from cfg registry to get base_url & api_key
|
||||
const registryProvider = findProviderFromRegistry(opts.provider);
|
||||
const providerValue = registryProvider ? `custom:${registryProvider.name}` : opts.provider;
|
||||
|
||||
// Ensure custom_providers in config.yaml contains this provider
|
||||
if (registryProvider) {
|
||||
if (!config.custom_providers) config.custom_providers = [];
|
||||
const existing = config.custom_providers.find((p) => p.name === registryProvider.name);
|
||||
if (!existing) {
|
||||
config.custom_providers.push(registryProvider);
|
||||
}
|
||||
}
|
||||
|
||||
for (const task of opts.auxTasks) {
|
||||
if (!config.auxiliary[task]) {
|
||||
config.auxiliary[task] = { provider: "", model: "", timeout: 30 };
|
||||
}
|
||||
config.auxiliary[task].provider = providerValue;
|
||||
if (registryProvider) {
|
||||
config.auxiliary[task].base_url = registryProvider.base_url;
|
||||
const apiKey = getProviderApiKey(registryProvider);
|
||||
if (apiKey) config.auxiliary[task].api_key = apiKey;
|
||||
}
|
||||
config.auxiliary[task].provider = opts.provider;
|
||||
if (opts.model) {
|
||||
config.auxiliary[task].model = opts.model;
|
||||
}
|
||||
console.log(` auxiliary.${task} → provider=${providerValue}${opts.model ? ` model=${opts.model}` : ""}`);
|
||||
console.log(` auxiliary.${task} → provider=${opts.provider}${opts.model ? ` model=${opts.model}` : ""}`);
|
||||
}
|
||||
} else {
|
||||
// Switch main provider — look up from cfg registry
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user