feat: add preset aliyun qwen model switching
This commit is contained in:
19
src/lib/ai-account-models.ts
Normal file
19
src/lib/ai-account-models.ts
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user