feat: 扩展 Model 设置功能
- 添加 Embedding 模型类型支持 - 优化模型设置表单样式 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -476,7 +476,7 @@ const saveStorageSettings = () => {
|
||||
{{ model.model }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="model-type-tag">{{ model.model_type }}</span>
|
||||
<span class="model-type-tag" :class="model.model_type">{{ model.model_type }}</span>
|
||||
</td>
|
||||
<td class="text-center text-sm">
|
||||
{{ model.base_url }}
|
||||
|
||||
@@ -65,14 +65,33 @@
|
||||
|
||||
/* Model Type 标签 */
|
||||
.model-type-tag {
|
||||
background-color: rgba(249, 115, 22, 0.2);
|
||||
color: #f97316;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
/* 不同类型的不同颜色 */
|
||||
.model-type-tag.chat {
|
||||
background-color: rgba(59, 130, 246, 0.2);
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.model-type-tag.embedding {
|
||||
background-color: rgba(34, 197, 94, 0.2);
|
||||
color: #22c55e;
|
||||
}
|
||||
|
||||
.model-type-tag.rerank {
|
||||
background-color: rgba(168, 85, 247, 0.2);
|
||||
color: #a855f7;
|
||||
}
|
||||
|
||||
.model-type-tag.vlm {
|
||||
background-color: rgba(249, 115, 22, 0.2);
|
||||
color: #f97316;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.btn-icon {
|
||||
padding: 6px;
|
||||
|
||||
@@ -27,6 +27,8 @@ export function useModelSettings() {
|
||||
|
||||
// 默认 Base URL 映射
|
||||
const defaultBaseUrls: Record<string, string> = {
|
||||
OpenAI: 'http://localhost:1234/v1',
|
||||
Ollama: 'http://localhost:11434',
|
||||
ali: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
}
|
||||
|
||||
@@ -120,6 +122,7 @@ export function useModelSettings() {
|
||||
body: JSON.stringify({
|
||||
provider: newModelForm.value.provider,
|
||||
model: newModelForm.value.model,
|
||||
model_type: newModelForm.value.modelType || 'chat',
|
||||
api_key: newModelForm.value.apiKey,
|
||||
base_url: newModelForm.value.baseUrl,
|
||||
api_endpoint: newModelForm.value.apiEndpoint,
|
||||
|
||||
Reference in New Issue
Block a user