mirror of
https://github.com/linshenkx/prompt-optimizer.git
synced 2026-05-06 21:50:27 +08:00
fix(ui): clarify minimax api endpoint guidance
This commit is contained in:
@@ -57,7 +57,7 @@ export class MinimaxAdapter extends OpenAIAdapter {
|
||||
return {
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
description: 'MiniMax AI models via OpenAI-compatible API',
|
||||
description: 'MiniMax AI models via OpenAI-compatible API. The default endpoint is global; Mainland China users should use https://api.minimaxi.com/v1.',
|
||||
requiresApiKey: true,
|
||||
defaultBaseURL: 'https://api.minimax.io/v1',
|
||||
supportsDynamicModels: true,
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('MinimaxAdapter', () => {
|
||||
providerMeta: {
|
||||
id: 'minimax',
|
||||
name: 'MiniMax',
|
||||
description: 'MiniMax AI models via OpenAI-compatible API',
|
||||
description: 'MiniMax AI models via OpenAI-compatible API. The default endpoint is global; Mainland China users should use https://api.minimaxi.com/v1.',
|
||||
requiresApiKey: true,
|
||||
defaultBaseURL: 'https://api.minimax.io/v1',
|
||||
supportsDynamicModels: true,
|
||||
@@ -100,6 +100,7 @@ describe('MinimaxAdapter', () => {
|
||||
expect(provider.defaultBaseURL).toBe('https://api.minimax.io/v1');
|
||||
expect(provider.supportsDynamicModels).toBe(true);
|
||||
expect(provider.requiresApiKey).toBe(true);
|
||||
expect(provider.description).toContain('https://api.minimaxi.com/v1');
|
||||
});
|
||||
|
||||
it('should have valid connection schema', () => {
|
||||
|
||||
@@ -49,7 +49,20 @@
|
||||
<template v-if="field.name === 'baseURL'" #label>
|
||||
<NSpace align="center" :size="4">
|
||||
<span>{{ t('modelManager.apiUrl') }}</span>
|
||||
<NText depth="3" :title="t('modelManager.apiUrlHint')" style="cursor: help;">?</NText>
|
||||
<NTooltip :show-arrow="false" placement="top">
|
||||
<template #trigger>
|
||||
<NButton
|
||||
class="api-url-help-button"
|
||||
quaternary
|
||||
circle
|
||||
size="tiny"
|
||||
:aria-label="t('modelManager.apiUrlHintAriaLabel')"
|
||||
>
|
||||
?
|
||||
</NButton>
|
||||
</template>
|
||||
<span class="api-url-help-text">{{ t('modelManager.apiUrlHint') }}</span>
|
||||
</NTooltip>
|
||||
</NSpace>
|
||||
</template>
|
||||
|
||||
@@ -295,6 +308,10 @@ const currentProviderHint = computed(() => {
|
||||
return t('modelManager.provider.dashscopeHint')
|
||||
}
|
||||
|
||||
if (provider.id === 'minimax') {
|
||||
return t('modelManager.provider.minimaxHint')
|
||||
}
|
||||
|
||||
return provider.description || ''
|
||||
})
|
||||
|
||||
@@ -392,3 +409,20 @@ const onProviderChange = (providerId: string) => {
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.api-url-help-button {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
min-width: 18px;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.api-url-help-text {
|
||||
display: block;
|
||||
max-width: 360px;
|
||||
line-height: 1.5;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -14,6 +14,7 @@ const messages = {
|
||||
"modelKey": "Model Key",
|
||||
"apiUrl": "API URL",
|
||||
"apiUrlHint": "Example: https://api.example.com/v1; most providers use endpoints ending with /v1",
|
||||
"apiUrlHintAriaLabel": "Show API URL help",
|
||||
"defaultModel": "Default Model",
|
||||
"clickToFetchModels": "Click arrow to fetch model list",
|
||||
"apiKey": "API Key",
|
||||
@@ -26,7 +27,8 @@ const messages = {
|
||||
"placeholder": "Select Provider",
|
||||
"openaiHint": "This is the official OpenAI API. If you want a custom base URL, a third-party compatible service, or a local model, choose \"Custom API (OpenAI Compatible)\" instead.",
|
||||
"customApiHint": "Use this for custom OpenAI-compatible endpoints. You can configure the base URL, use your own model name, and choose Chat Completions or Responses as the request style.",
|
||||
"dashscopeHint": "DashScope supports both OpenAI-compatible Chat Completions and Responses APIs. You can switch the request style here directly."
|
||||
"dashscopeHint": "DashScope supports both OpenAI-compatible Chat Completions and Responses APIs. You can switch the request style here directly.",
|
||||
"minimaxHint": "The default endpoint is the global MiniMax OpenAI-compatible API. Mainland China users should set API URL to https://api.minimaxi.com/v1. Do not use Anthropic-format MiniMax endpoints here."
|
||||
},
|
||||
"connection": {
|
||||
"accountId": "Account ID",
|
||||
|
||||
@@ -14,6 +14,7 @@ const messages = {
|
||||
"modelKey": "模型标识",
|
||||
"apiUrl": "API地址",
|
||||
"apiUrlHint": "示例:https://api.example.com/v1;多数提供商地址通常以 /v1 结尾",
|
||||
"apiUrlHintAriaLabel": "显示 API 地址说明",
|
||||
"defaultModel": "默认模型",
|
||||
"selectModel": "选择模型",
|
||||
"clickToFetchModels": "点击箭头获取模型列表",
|
||||
@@ -27,7 +28,8 @@ const messages = {
|
||||
"placeholder": "选择提供商",
|
||||
"openaiHint": "官方 OpenAI API 入口。如果你想接入自定义 Base URL、第三方兼容服务或本地模型,请选择“Custom API (OpenAI Compatible)”。",
|
||||
"customApiHint": "用于接入自定义 OpenAI 兼容接口。你可以配置 Base URL、自定义模型名,并选择 Chat Completions 或 Responses 请求风格。",
|
||||
"dashscopeHint": "阿里百炼已支持 OpenAI 兼容的 Chat Completions 与 Responses 接口。当前可直接在这里切换请求风格进行使用。"
|
||||
"dashscopeHint": "阿里百炼已支持 OpenAI 兼容的 Chat Completions 与 Responses 接口。当前可直接在这里切换请求风格进行使用。",
|
||||
"minimaxHint": "默认地址是 MiniMax 海外 OpenAI 兼容接口。国内用户请将 API 地址改为 https://api.minimaxi.com/v1;这里不要使用 MiniMax 的 Anthropic 格式地址。"
|
||||
},
|
||||
"connection": {
|
||||
"accountId": "账户 ID",
|
||||
|
||||
@@ -14,6 +14,7 @@ const messages = {
|
||||
"modelKey": "模型標識",
|
||||
"apiUrl": "API位址",
|
||||
"apiUrlHint": "範例:https://api.example.com/v1;多數提供商位址通常以 /v1 結尾",
|
||||
"apiUrlHintAriaLabel": "顯示 API 位址說明",
|
||||
"defaultModel": "預設模型",
|
||||
"clickToFetchModels": "點選箭頭取得模型清單",
|
||||
"apiKey": "API金鑰",
|
||||
@@ -26,7 +27,8 @@ const messages = {
|
||||
"placeholder": "選擇提供商",
|
||||
"openaiHint": "這是官方 OpenAI API 入口。如果你想接入自訂 Base URL、第三方相容服務或本地模型,請選擇「Custom API (OpenAI Compatible)」。",
|
||||
"customApiHint": "用於接入自訂 OpenAI 相容接口。你可以配置 Base URL、自訂模型名稱,並選擇 Chat Completions 或 Responses 請求風格。",
|
||||
"dashscopeHint": "阿里百鍊已支援 OpenAI 相容的 Chat Completions 與 Responses 接口,目前可直接在這裡切換請求風格使用。"
|
||||
"dashscopeHint": "阿里百鍊已支援 OpenAI 相容的 Chat Completions 與 Responses 接口,目前可直接在這裡切換請求風格使用。",
|
||||
"minimaxHint": "預設位址是 MiniMax 海外 OpenAI 相容接口。中國大陸用戶請將 API 位址改為 https://api.minimaxi.com/v1;這裡不要使用 MiniMax 的 Anthropic 格式位址。"
|
||||
},
|
||||
"connection": {
|
||||
"accountId": "帳戶 ID",
|
||||
|
||||
@@ -138,6 +138,20 @@ describe('ui runtime english guards', () => {
|
||||
expect(source).not.toMatch(/'Unknown error'/)
|
||||
})
|
||||
|
||||
it('keeps text model API URL and MiniMax guidance locale-backed', () => {
|
||||
const source = readUiSource('src/components/TextModelEditModal.vue')
|
||||
|
||||
expect(source).toMatch(/NTooltip/)
|
||||
expect(source).toMatch(/modelManager\.apiUrlHintAriaLabel/)
|
||||
expect(source).toMatch(/modelManager\.provider\.minimaxHint/)
|
||||
expect(source).not.toMatch(/:title="t\('modelManager\.apiUrlHint'\)"/)
|
||||
|
||||
expect(enUS.modelManager.apiUrlHintAriaLabel).toBe('Show API URL help')
|
||||
expect(enUS.modelManager.provider.minimaxHint).toContain('https://api.minimaxi.com/v1')
|
||||
expect(zhCN.modelManager.provider.minimaxHint).toContain('https://api.minimaxi.com/v1')
|
||||
expect(zhTW.modelManager.provider.minimaxHint).toContain('https://api.minimaxi.com/v1')
|
||||
})
|
||||
|
||||
it('keeps prompt testing and test mode config free of hardcoded chinese runtime strings', () => {
|
||||
const promptTesterSource = readUiSource('src/composables/prompt/usePromptTester.ts')
|
||||
const modeConfigSource = readUiSource('src/composables/ui/useTestModeConfig.ts')
|
||||
|
||||
Reference in New Issue
Block a user