applySetup function
Implementation
SetupConfig applySetup(SetupConfig existing,
{String? router,
String? routerApiKey,
String? siteUrl,
String? upgradeUrl,
String? compute,
String? hfToken,
String? modelscopeApiToken}) {
final out = existing.copy();
if (router != null) out.router = router;
if (routerApiKey != null) out.routerApiKey = routerApiKey;
if (siteUrl != null) out.siteUrl = siteUrl;
if (upgradeUrl != null) out.upgradeUrl = upgradeUrl;
if (compute != null) out.compute = compute;
if (hfToken != null) out.hfToken = hfToken;
if (modelscopeApiToken != null) out.modelscopeApiToken = modelscopeApiToken;
if (!computes.contains(out.compute)) {
throw ArgumentError('invalid compute: ${out.compute}');
}
return fillSetupUrls(out);
}