mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
parent
096fabb5d6
commit
eb95c131be
644 changed files with 70389 additions and 23709 deletions
|
|
@ -4,18 +4,30 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { AuthType, DEFAULT_QWEN_MODEL } from '@qwen-code/qwen-code-core';
|
||||
|
||||
export type AvailableModel = {
|
||||
id: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
isVision?: boolean;
|
||||
};
|
||||
|
||||
export const MAINLINE_VLM = 'vision-model';
|
||||
export const MAINLINE_CODER = 'coder-model';
|
||||
export const MAINLINE_CODER = DEFAULT_QWEN_MODEL;
|
||||
|
||||
export const AVAILABLE_MODELS_QWEN: AvailableModel[] = [
|
||||
{ id: MAINLINE_CODER, label: MAINLINE_CODER },
|
||||
{ id: MAINLINE_VLM, label: MAINLINE_VLM, isVision: true },
|
||||
{
|
||||
id: MAINLINE_CODER,
|
||||
label: MAINLINE_CODER,
|
||||
description: 'Optimized for code generation and understanding',
|
||||
},
|
||||
{
|
||||
id: MAINLINE_VLM,
|
||||
label: MAINLINE_VLM,
|
||||
description: 'Vision model with multimodal capabilities',
|
||||
isVision: true,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -39,6 +51,23 @@ export function getOpenAIAvailableModelFromEnv(): AvailableModel | null {
|
|||
return id ? { id, label: id } : null;
|
||||
}
|
||||
|
||||
export function getAvailableModelsForAuthType(
|
||||
authType: AuthType,
|
||||
): AvailableModel[] {
|
||||
switch (authType) {
|
||||
case AuthType.QWEN_OAUTH:
|
||||
return AVAILABLE_MODELS_QWEN;
|
||||
case AuthType.USE_OPENAI: {
|
||||
const openAIModel = getOpenAIAvailableModelFromEnv();
|
||||
return openAIModel ? [openAIModel] : [];
|
||||
}
|
||||
default:
|
||||
// For other auth types, return empty array for now
|
||||
// This can be expanded later according to the design doc
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Hard code the default vision model as a string literal,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue