mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
fix: remove test code and switch-mode
This commit is contained in:
parent
ae6716c651
commit
740f4e0949
13 changed files with 43 additions and 367 deletions
|
|
@ -9,14 +9,8 @@ import {
|
|||
getAvailableModelsForAuthType,
|
||||
getFilteredQwenModels,
|
||||
getOpenAIAvailableModelFromEnv,
|
||||
isVisionModel,
|
||||
getDefaultVisionModel,
|
||||
} from './availableModels.js';
|
||||
import {
|
||||
AuthType,
|
||||
type Config,
|
||||
DEFAULT_QWEN_MODEL,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { AuthType, type Config } from '@qwen-code/qwen-code-core';
|
||||
|
||||
describe('availableModels', () => {
|
||||
describe('Qwen models', () => {
|
||||
|
|
@ -189,20 +183,4 @@ describe('availableModels', () => {
|
|||
expect(models).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isVisionModel', () => {
|
||||
it('should return true for coder-model with vision capability', () => {
|
||||
expect(isVisionModel('coder-model')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for unknown model', () => {
|
||||
expect(isVisionModel('unknown-model')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getDefaultVisionModel', () => {
|
||||
it('should return the default model ID', () => {
|
||||
expect(getDefaultVisionModel()).toBe(DEFAULT_QWEN_MODEL);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,11 +20,8 @@ export type AvailableModel = {
|
|||
isVision?: boolean;
|
||||
};
|
||||
|
||||
// Re-export constants from core for backwards compatibility
|
||||
export {
|
||||
DEFAULT_QWEN_MODEL as MAINLINE_CODER,
|
||||
DEFAULT_QWEN_MODEL as MAINLINE_VLM,
|
||||
};
|
||||
// Re-export constant from core for backwards compatibility
|
||||
export { DEFAULT_QWEN_MODEL as MAINLINE_CODER };
|
||||
|
||||
const CACHED_QWEN_OAUTH_MODELS: AvailableModel[] = QWEN_OAUTH_MODELS.map(
|
||||
(model) => ({
|
||||
|
|
@ -134,21 +131,3 @@ export function getAvailableModelsForAuthType(
|
|||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* coder-model now has vision capabilities by default.
|
||||
* This function is kept for backwards compatibility but always returns the current model.
|
||||
*/
|
||||
export function getDefaultVisionModel(): string {
|
||||
return DEFAULT_QWEN_MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* coder-model now has vision capabilities by default.
|
||||
* This function is kept for backwards compatibility but always returns true for the default model.
|
||||
*/
|
||||
export function isVisionModel(modelId: string): boolean {
|
||||
return getQwenOAuthModels().some(
|
||||
(model) => model.id === modelId && model.isVision,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue