Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0f272b102763736001a82cfda23f35ff2ee9cac8 Co-authored-by: bianbiandashen <16240681+bianbiandashen@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
16 lines
630 B
TypeScript
16 lines
630 B
TypeScript
import { logConfigUpdated } from "../../config/logging.js";
|
|
import { resolveAgentModelPrimaryValue } from "../../config/model-input.js";
|
|
import type { RuntimeEnv } from "../../runtime.js";
|
|
import { applyDefaultModelPrimaryUpdate, updateConfig } from "./shared.js";
|
|
|
|
export async function modelsSetCommand(modelRaw: string, runtime: RuntimeEnv) {
|
|
const updated = await updateConfig((cfg) => {
|
|
return applyDefaultModelPrimaryUpdate({ cfg, modelRaw, field: "model" });
|
|
});
|
|
|
|
logConfigUpdated(runtime);
|
|
runtime.log(
|
|
`Default model: ${resolveAgentModelPrimaryValue(updated.agents?.defaults?.model) ?? modelRaw}`,
|
|
);
|
|
}
|