mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-04 22:51:08 +00:00
fix(auth): update references to Alibaba Cloud ModelStudio Standard API Key in AuthDialog
- Changed all instances of "Alibaba Cloud Standard API Key" to "Alibaba Cloud ModelStudio Standard API Key" in AuthDialog and related tests. - Added documentation links for ModelStudio Standard API Key based on region selection. - Enhanced user feedback messages to reflect the new API key terminology.
This commit is contained in:
parent
ddc397360f
commit
5871be4496
3 changed files with 48 additions and 12 deletions
|
|
@ -603,7 +603,7 @@ describe('AuthDialog', () => {
|
|||
await wait();
|
||||
|
||||
expect(lastFrame()).toContain('Select API Key Type');
|
||||
expect(lastFrame()).toContain('Alibaba Cloud Standard API Key');
|
||||
expect(lastFrame()).toContain('Alibaba Cloud ModelStudio Standard API Key');
|
||||
expect(lastFrame()).toContain('Custom API Key');
|
||||
|
||||
// Move to Custom API Key and enter
|
||||
|
|
@ -615,7 +615,7 @@ describe('AuthDialog', () => {
|
|||
unmount();
|
||||
});
|
||||
|
||||
it('shows Alibaba Cloud Standard API Key region endpoint', async () => {
|
||||
it('shows Alibaba Cloud ModelStudio Standard API Key region endpoint', async () => {
|
||||
const settings: LoadedSettings = new LoadedSettings(
|
||||
{
|
||||
settings: { ui: { customThemes: {} }, mcpServers: {} },
|
||||
|
|
@ -658,7 +658,7 @@ describe('AuthDialog', () => {
|
|||
stdin.write('\r');
|
||||
await wait();
|
||||
|
||||
// API Key type -> Alibaba Cloud Standard API Key (default)
|
||||
// API Key type -> Alibaba Cloud ModelStudio Standard API Key (default)
|
||||
stdin.write('\r');
|
||||
await wait();
|
||||
|
||||
|
|
@ -667,7 +667,9 @@ describe('AuthDialog', () => {
|
|||
stdin.write('\r');
|
||||
await wait();
|
||||
|
||||
expect(lastFrame()).toContain('Enter Alibaba Cloud Standard API Key');
|
||||
expect(lastFrame()).toContain(
|
||||
'Enter Alibaba Cloud ModelStudio Standard API Key',
|
||||
);
|
||||
expect(lastFrame()).toContain(
|
||||
'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -58,6 +58,18 @@ type ViewLevel =
|
|||
| 'custom-info';
|
||||
|
||||
const ALIBABA_STANDARD_MODEL_IDS_PLACEHOLDER = 'qwen3.5-plus,glm-5,kimi-k2.5';
|
||||
const ALIBABA_STANDARD_API_DOCUMENTATION_URLS: Record<
|
||||
AlibabaStandardRegion,
|
||||
string
|
||||
> = {
|
||||
'cn-beijing': 'https://bailian.console.aliyun.com/cn-beijing?tab=api#/api',
|
||||
'sg-singapore':
|
||||
'https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=api#/api/?type=model&url=2712195',
|
||||
'us-virginia':
|
||||
'https://modelstudio.console.alibabacloud.com/us-east-1?tab=api#/api/?type=model&url=2712195',
|
||||
'cn-hongkong':
|
||||
'https://modelstudio.console.alibabacloud.com/cn-hongkong?tab=api#/api/?type=model&url=2712195',
|
||||
};
|
||||
|
||||
export function AuthDialog(): React.JSX.Element {
|
||||
const { pendingAuthType, authError } = useUIState();
|
||||
|
|
@ -203,8 +215,8 @@ export function AuthDialog(): React.JSX.Element {
|
|||
const apiKeyTypeItems = [
|
||||
{
|
||||
key: 'ALIBABA_STANDARD_API_KEY',
|
||||
title: t('Alibaba Cloud Standard API Key'),
|
||||
label: t('Alibaba Cloud Standard API Key'),
|
||||
title: t('Alibaba Cloud ModelStudio Standard API Key'),
|
||||
label: t('Alibaba Cloud ModelStudio Standard API Key'),
|
||||
description: t('Quick setup for Model Studio (China/International)'),
|
||||
value: 'ALIBABA_STANDARD_API_KEY' as ApiKeyOption,
|
||||
},
|
||||
|
|
@ -527,14 +539,24 @@ export function AuthDialog(): React.JSX.Element {
|
|||
|
||||
const renderAlibabaStandardApiKeyInputView = () => (
|
||||
<Box marginTop={1} flexDirection="column">
|
||||
<Text color={theme.text.primary}>
|
||||
{t('Enter your Alibaba Cloud Model Studio API key')}
|
||||
</Text>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.secondary}>
|
||||
Endpoint: {ALIBABA_STANDARD_API_KEY_ENDPOINTS[alibabaStandardRegion]}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.text.secondary}>{t('Documentation')}:</Text>
|
||||
</Box>
|
||||
<Box marginTop={0}>
|
||||
<Link
|
||||
url={ALIBABA_STANDARD_API_DOCUMENTATION_URLS[alibabaStandardRegion]}
|
||||
fallback={false}
|
||||
>
|
||||
<Text color={theme.text.link}>
|
||||
{ALIBABA_STANDARD_API_DOCUMENTATION_URLS[alibabaStandardRegion]}
|
||||
</Text>
|
||||
</Link>
|
||||
</Box>
|
||||
<Box marginTop={1}>
|
||||
<TextInput
|
||||
value={alibabaStandardApiKey}
|
||||
|
|
@ -633,9 +655,11 @@ export function AuthDialog(): React.JSX.Element {
|
|||
case 'custom-info':
|
||||
return t('Custom Configuration');
|
||||
case 'alibaba-standard-region-select':
|
||||
return t('Select Region for Alibaba Cloud Standard API Key');
|
||||
return t(
|
||||
'Select Region for Alibaba Cloud ModelStudio Standard API Key',
|
||||
);
|
||||
case 'alibaba-standard-api-key-input':
|
||||
return t('Enter Alibaba Cloud Standard API Key');
|
||||
return t('Enter Alibaba Cloud ModelStudio Standard API Key');
|
||||
case 'alibaba-standard-model-id-input':
|
||||
return t('Enter Model IDs');
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -524,13 +524,23 @@ export const useAuthCommand = (
|
|||
{
|
||||
type: MessageType.INFO,
|
||||
text: t(
|
||||
'Authenticated successfully with Alibaba Cloud Standard API Key. Settings updated with env.DASHSCOPE_API_KEY and {{modelCount}} model(s).',
|
||||
'Alibaba Cloud ModelStudio Standard API Key successfully entered. Settings updated with env.DASHSCOPE_API_KEY and {{modelCount}} model(s).',
|
||||
{ modelCount: String(modelIds.length) },
|
||||
),
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
|
||||
addItem(
|
||||
{
|
||||
type: MessageType.INFO,
|
||||
text: t(
|
||||
'You can use /model to see new ModelStudio Standard models and switch between them.',
|
||||
),
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
|
||||
const authEvent = new AuthEvent(
|
||||
AuthType.USE_OPENAI,
|
||||
'manual',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue