fix(moonshot): Enhance moonshot provider configuration: prioritize baseUrl from config for api.moonshot.cn integration.
This commit is contained in:
parent
2370ea5d1b
commit
05acf56fbe
@ -318,6 +318,14 @@ export async function runEmbeddedPiAgent(
|
||||
});
|
||||
}
|
||||
|
||||
// Moonshot: prefer config baseUrl so .cn key is used with api.moonshot.cn (not .ai).
|
||||
if (normalizeProviderId(provider) === "moonshot") {
|
||||
const moonshotBaseUrl = params.config?.models?.providers?.moonshot?.baseUrl;
|
||||
if (typeof moonshotBaseUrl === "string" && moonshotBaseUrl.trim()) {
|
||||
(model as { baseUrl?: string }).baseUrl = moonshotBaseUrl.trim();
|
||||
}
|
||||
}
|
||||
|
||||
const ctxInfo = resolveContextWindowInfo({
|
||||
cfg: params.config,
|
||||
provider,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user