feat: add preset aliyun qwen model switching

This commit is contained in:
kris
2026-04-01 08:04:31 +08:00
parent e52932e8ef
commit a4655439dd
7 changed files with 332 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
export const ALIYUN_QWEN_PRESET_MODELS = ["qwen3.5-plus", "qwen3.5-flash"] as const;
export const ALIYUN_QWEN_CUSTOM_MODEL_VALUE = "__custom__";
export function isAliyunQwenPresetModel(model: string | null | undefined) {
const trimmed = model?.trim() ?? "";
return ALIYUN_QWEN_PRESET_MODELS.includes(trimmed as (typeof ALIYUN_QWEN_PRESET_MODELS)[number]);
}
export function resolveAliyunQwenModelSelection(model: string | null | undefined) {
return isAliyunQwenPresetModel(model) ? (model?.trim() ?? "") : ALIYUN_QWEN_CUSTOM_MODEL_VALUE;
}
export function resolveAliyunQwenModelValue(selection: string, customModel: string) {
if (selection === ALIYUN_QWEN_CUSTOM_MODEL_VALUE) {
return customModel.trim();
}
return selection.trim();
}