20 lines
754 B
TypeScript
20 lines
754 B
TypeScript
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();
|
|
}
|