Skip to content

Commit ed224a5

Browse files
committed
[Improvement] The suffixes of LLM and embedding models are not consistent during configuration #1402
1 parent 9e9253c commit ed224a5

File tree

5 files changed

+68
-9
lines changed

5 files changed

+68
-9
lines changed

doc/docs/en/user-guide/model-configuration.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Nexent will soon support seamless integration with the ModelEngine platform, ena
1919
- **Display Name:** Optionally set a display name for the model (defaults to the model name).
2020
- **Model URL (required):** Enter the API endpoint provided by the model provider.
2121
- **API Key:** Enter your API key.
22+
23+
> ⚠️ **Notes**:
24+
> 1. Obtain the model name from the model provider, typically in the format `model series/model name`. For example, if the model series is `Qwen` and the model name is `Qwen3-8B`, the model name is `Qwen/Qwen3-8B`.
25+
> 2. Obtain the model URL from the model provider's API documentation. For example, if the model provider is Silicon Flow, the URL for the large language model is `https://api.siliconflow.cn/v1`, the URL for the vector model is `https://api.siliconflow.cn/v1/embeddings`, and the URL for the visual language model is `https://api.siliconflow.cn/v1`.
26+
> 3. Create and obtain an API key from the model provider's API key management page.
27+
2228
4. **Connectivity Verification**
2329
- Click the "Verify" button. The system will send a test request and return the result.
2430
5. **Save Model**

doc/docs/zh/user-guide/model-configuration.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Nexent即将支持与ModelEngine平台的无缝对接,届时可自动同步并
99
## 🛠️ 添加自定义模型
1010

1111
### 添加单个模型
12-
12+
#### 添加单个模型步骤
1313
1. **添加自定义模型**
1414
- 点击"添加自定义模型"按钮,进入添加模型弹窗。
1515
2. **选择模型类型**
@@ -19,6 +19,12 @@ Nexent即将支持与ModelEngine平台的无缝对接,届时可自动同步并
1919
- **展示名称**:可为模型设置一个展示名称,默认与模型名称相同。
2020
- **模型URL(必填)**:输入模型提供商的API端点。
2121
- **API Key**:输入您的API密钥。
22+
23+
> ⚠️ **注意事项**
24+
> 1. 模型名称通过模型提供商获取,通常格式为`模型系列/模型名字`。以模型系列是`Qwen`,模型名字是`Qwen3-8B`为例,模型名称为`Qwen/Qwen3-8B`
25+
> 2. 模型URL通过模型提供商的API文档获取。以模型提供商是硅基流动为例,大语言模型URL为`https://api.siliconflow.cn/v1` ,向量模型URL为`https://api.siliconflow.cn/v1/embeddings` ,视觉语言模型URL为`https://api.siliconflow.cn/v1`
26+
> 3. API Key通过模型提供商的API Key密钥管理页面创建并获取API Key。
27+
2228
4. **连通性验证**
2329
- 点击"连通性验证"按钮,系统会发送测试请求并返回验证结果。
2430
5. **保存模型**
@@ -34,7 +40,7 @@ Nexent即将支持与ModelEngine平台的无缝对接,届时可自动同步并
3440

3541
1. **批量添加模型**
3642
- 在添加模型弹窗中,打开批量添加模型开关。
37-
4. **选择模型提供商**
43+
2. **选择模型提供商**
3844
- 点击模型提供商下拉框,选择模型提供商。
3945
3. **选择模型类型**
4046
- 点击模型类型下拉框,选择要添加的模型类型(大语言模型/向量化模型/视觉语言模型)。

frontend/app/[locale]/setup/models/components/model/ModelAddDialog.tsx

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,56 @@ export const ModelAddDialog = ({ isOpen, onClose, onSuccess }: ModelAddDialogPro
645645
<InfoCircleFilled className="text-md text-blue-500 mr-3" />
646646
<p className="font-bold text-medium">{t('model.dialog.help.title')}</p>
647647
</div>
648-
<p className="mt-0.5 ml-6">
649-
{form.isBatchImport ? t('model.dialog.help.content.batchImport') : t('model.dialog.help.content')}
650-
</p>
648+
<div className="mt-0.5 ml-6">
649+
{(form.isBatchImport ? t('model.dialog.help.content.batchImport') : t('model.dialog.help.content')).split('\n').map((line, index) => {
650+
// Parse Markdown-style links: [text](url)
651+
const markdownLinkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
652+
const parts: (string | { text: string; url: string })[] = [];
653+
let lastIndex = 0;
654+
let match;
655+
656+
while ((match = markdownLinkRegex.exec(line)) !== null) {
657+
// Add text before the link
658+
if (match.index > lastIndex) {
659+
parts.push(line.substring(lastIndex, match.index));
660+
}
661+
// Add the link object
662+
parts.push({ text: match[1], url: match[2] });
663+
lastIndex = match.index + match[0].length;
664+
}
665+
666+
// Add remaining text after the last link
667+
if (lastIndex < line.length) {
668+
parts.push(line.substring(lastIndex));
669+
}
670+
671+
// If no links found, just add the whole line
672+
if (parts.length === 0) {
673+
parts.push(line);
674+
}
675+
676+
return (
677+
<p key={index} className={index > 0 ? 'mt-1' : ''}>
678+
{parts.map((part, partIndex) => {
679+
if (typeof part === 'object') {
680+
return (
681+
<a
682+
key={partIndex}
683+
href={part.url}
684+
target="_blank"
685+
rel="noopener noreferrer"
686+
className="text-blue-600 hover:text-blue-800 underline"
687+
>
688+
{part.text}
689+
</a>
690+
);
691+
}
692+
return <span key={partIndex}>{part}</span>;
693+
})}
694+
</p>
695+
);
696+
})}
697+
</div>
651698
<div className="mt-2 ml-6 flex items-center">
652699
<span>{t('model.dialog.label.currentlySupported')}</span>
653700
{form.isBatchImport && (

frontend/public/locales/en/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@
551551
"model.dialog.button.verifying": "Verifying...",
552552
"model.dialog.button.add": "Add",
553553
"model.dialog.help.title": "Model Configuration Guide",
554-
"model.dialog.help.content": "Please fill in the model's basic information. API Key and display name are optional, other fields are required. It's recommended to verify connectivity before adding the model.",
555-
"model.dialog.help.content.batchImport": "Please fill in the provider's basic information. API Key and provider name are required, other fields are optional. It's recommended to verify connectivity before adding the model.",
554+
"model.dialog.help.content": "Please fill in the model's basic information. API Key and display name are optional, other fields are required. It's recommended to verify connectivity before adding the model. For detailed configuration methods, please refer to [Model Configuration](https://modelengine-group.github.io/nexent/en/user-guide/model-configuration.html).",
555+
"model.dialog.help.content.batchImport": "Please fill in the provider's basic information. API Key and provider name are required, other fields are optional. It's recommended to verify connectivity before adding the model. For detailed configuration methods, please refer to [Model Configuration](https://modelengine-group.github.io/nexent/en/user-guide/model-configuration.html).",
556556
"model.dialog.warning.incompleteForm": "Please complete the model configuration information first",
557557
"model.dialog.status.verifying": "Verifying model connectivity...",
558558
"model.dialog.success.connectivityVerified": "Model connectivity verification successful!",

frontend/public/locales/zh/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@
552552
"model.dialog.button.verifying": "验证中...",
553553
"model.dialog.button.add": "添加",
554554
"model.dialog.help.title": "模型配置说明",
555-
"model.dialog.help.content": "请填写模型的基本信息,API Key、展示名称为可选项,其他字段为必填项。建议先验证连通性后再添加模型。",
556-
"model.dialog.help.content.batchImport": "请填写提供商的基本信息,API Key和提供商名称为必填项,其他字段为可选项。",
555+
"model.dialog.help.content": "请填写模型的基本信息,API Key、展示名称为可选项,其他字段为必填项。建议先验证连通性后再添加模型。详细配置方法请参考[模型配置](https://modelengine-group.github.io/nexent/zh/user-guide/model-configuration.html)。",
556+
"model.dialog.help.content.batchImport": "请填写提供商的基本信息,API Key和提供商名称为必填项,其他字段为可选项。详细配置方法请参考[模型配置](https://modelengine-group.github.io/nexent/zh/user-guide/model-configuration.html)。",
557557
"model.dialog.warning.incompleteForm": "请先填写完整的模型配置信息",
558558
"model.dialog.status.verifying": "正在验证模型连通性...",
559559
"model.dialog.error.addFailed": "添加模型失败:{{error}}",

0 commit comments

Comments
 (0)