feat: 新增对多家平台的模型适配
This commit is contained in:
@@ -278,6 +278,7 @@ export function testEmbeddingModel(modelConfig: {
|
||||
baseUrl?: string;
|
||||
apiKey?: string;
|
||||
dimension?: number;
|
||||
provider?: string;
|
||||
}): Promise<{ available: boolean; message?: string; dimension?: number }> {
|
||||
return new Promise((resolve, reject) => {
|
||||
post('/api/v1/initialization/embedding/test', modelConfig)
|
||||
@@ -318,7 +319,7 @@ export function testMultimodalFunction(testData: {
|
||||
vlm_base_url: string;
|
||||
vlm_api_key?: string;
|
||||
vlm_interface_type?: string;
|
||||
storage_type?: 'cos'|'minio';
|
||||
storage_type?: 'cos' | 'minio';
|
||||
// COS optional fields (required only when storage_type === 'cos')
|
||||
cos_secret_id?: string;
|
||||
cos_secret_key?: string;
|
||||
@@ -397,18 +398,18 @@ export function testMultimodalFunction(testData: {
|
||||
headers,
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then((data: any) => {
|
||||
if (data.success) {
|
||||
resolve(data.data || {});
|
||||
} else {
|
||||
resolve({ success: false, message: data.message || '测试失败' });
|
||||
}
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.error('多模态测试失败:', error);
|
||||
reject(error);
|
||||
});
|
||||
.then(response => response.json())
|
||||
.then((data: any) => {
|
||||
if (data.success) {
|
||||
resolve(data.data || {});
|
||||
} else {
|
||||
resolve({ success: false, message: data.message || '测试失败' });
|
||||
}
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.error('多模态测试失败:', error);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -480,14 +481,14 @@ export function fabriText(request: FabriTextRequest): Promise<FabriTextResponse>
|
||||
}
|
||||
|
||||
export interface FabriTagRequest {
|
||||
llm_config: LLMConfig;
|
||||
llm_config: LLMConfig;
|
||||
}
|
||||
|
||||
export interface FabriTagResponse {
|
||||
tags: string[];
|
||||
}
|
||||
|
||||
// 文本内容生成
|
||||
// 标签生成
|
||||
export function fabriTag(request: FabriTagRequest): Promise<FabriTagResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
post('/api/v1/initialization/extract/fabri-tag', request)
|
||||
@@ -499,4 +500,30 @@ export function fabriTag(request: FabriTagRequest): Promise<FabriTagResponse> {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 模型厂商信息类型
|
||||
export interface ModelProviderOption {
|
||||
value: string; // provider 标识符
|
||||
label: string; // 显示名称
|
||||
description: string; // 描述
|
||||
defaultUrls: Record<string, string>; // 按模型类型区分的默认 URL
|
||||
modelTypes: string[]; // 支持的模型类型
|
||||
}
|
||||
|
||||
// 获取模型厂商列表
|
||||
export function listModelProviders(modelType?: string): Promise<ModelProviderOption[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = modelType
|
||||
? `/api/v1/models/providers?model_type=${encodeURIComponent(modelType)}`
|
||||
: '/api/v1/models/providers';
|
||||
get(url)
|
||||
.then((response: any) => {
|
||||
resolve(response.data || []);
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.error('获取模型厂商列表失败:', error);
|
||||
resolve([]); // 失败时返回空数组,前端可以回退到默认值
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -11,12 +11,14 @@ export interface ModelConfig {
|
||||
parameters: {
|
||||
base_url?: string;
|
||||
api_key?: string;
|
||||
provider?: string; // Provider identifier: openai, aliyun, zhipu, generic
|
||||
embedding_parameters?: {
|
||||
dimension?: number;
|
||||
truncate_prompt_tokens?: number;
|
||||
};
|
||||
interface_type?: 'ollama' | 'openai'; // VLLM专用
|
||||
parameter_size?: string; // Ollama模型参数大小 (e.g., "7B", "13B", "70B")
|
||||
extra_config?: Record<string, string>; // Provider-specific configuration
|
||||
};
|
||||
is_default?: boolean;
|
||||
is_builtin?: boolean;
|
||||
|
||||
@@ -119,17 +119,39 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Remote API 和 VLLM 保持原有的 input -->
|
||||
<div v-else class="form-item">
|
||||
<label class="form-label required">{{ $t('model.modelName') }}</label>
|
||||
<t-input
|
||||
v-model="formData.modelName"
|
||||
:placeholder="getModelNamePlaceholder()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Remote API 配置 -->
|
||||
<template v-if="formData.source === 'remote'">
|
||||
<!-- 厂商选择器 -->
|
||||
<div class="form-item">
|
||||
<label class="form-label">{{ $t('model.editor.providerLabel') }}</label>
|
||||
<t-select
|
||||
v-model="formData.provider"
|
||||
:placeholder="$t('model.editor.providerPlaceholder')"
|
||||
@change="handleProviderChange"
|
||||
>
|
||||
<t-option
|
||||
v-for="opt in providerOptions"
|
||||
:key="opt.value"
|
||||
:value="opt.value"
|
||||
:label="opt.label"
|
||||
>
|
||||
<div class="provider-option">
|
||||
<span class="provider-name">{{ opt.label }}</span>
|
||||
<span class="provider-desc">{{ opt.description }}</span>
|
||||
</div>
|
||||
</t-option>
|
||||
</t-select>
|
||||
</div>
|
||||
|
||||
<!-- 模型名称 -->
|
||||
<div class="form-item">
|
||||
<label class="form-label required">{{ $t('model.modelName') }}</label>
|
||||
<t-input
|
||||
v-model="formData.modelName"
|
||||
:placeholder="getModelNamePlaceholder()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<label class="form-label required">{{ $t('model.editor.baseUrlLabel') }}</label>
|
||||
<t-input
|
||||
@@ -229,7 +251,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, computed, onUnmounted, nextTick } from 'vue'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import { checkOllamaModels, checkRemoteModel, testEmbeddingModel, checkRerankModel, listOllamaModels, downloadOllamaModel, getDownloadProgress, checkOllamaStatus, type OllamaModelInfo } from '@/api/initialization'
|
||||
import { checkOllamaModels, checkRemoteModel, testEmbeddingModel, checkRerankModel, listOllamaModels, downloadOllamaModel, getDownloadProgress, checkOllamaStatus, listModelProviders, type OllamaModelInfo, type ModelProviderOption } from '@/api/initialization'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUIStore } from '@/stores/ui'
|
||||
|
||||
@@ -237,6 +259,7 @@ interface ModelFormData {
|
||||
id: string
|
||||
name: string
|
||||
source: 'local' | 'remote'
|
||||
provider?: string // Provider identifier: openai, aliyun, zhipu, generic, etc.
|
||||
modelName: string
|
||||
baseUrl?: string
|
||||
apiKey?: string
|
||||
@@ -264,6 +287,111 @@ const emit = defineEmits<{
|
||||
'confirm': [data: ModelFormData]
|
||||
}>()
|
||||
|
||||
// API 返回的 Provider 列表
|
||||
const apiProviderOptions = ref<ModelProviderOption[]>([])
|
||||
const loadingProviders = ref(false)
|
||||
|
||||
// 硬编码的后备 Provider 配置 (当 API 不可用时使用)
|
||||
const fallbackProviderOptions = computed(() => [
|
||||
{
|
||||
value: 'openai',
|
||||
label: t('model.editor.providers.openai.label'),
|
||||
defaultUrls: {
|
||||
chat: 'https://api.openai.com/v1',
|
||||
embedding: 'https://api.openai.com/v1',
|
||||
rerank: 'https://api.openai.com/v1',
|
||||
vllm: 'https://api.openai.com/v1'
|
||||
},
|
||||
description: t('model.editor.providers.openai.description'),
|
||||
modelTypes: ['chat', 'embedding', 'vllm']
|
||||
},
|
||||
{
|
||||
value: 'aliyun',
|
||||
label: t('model.editor.providers.aliyun.label'),
|
||||
defaultUrls: {
|
||||
chat: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
embedding: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
||||
rerank: 'https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank',
|
||||
vllm: 'https://dashscope.aliyuncs.com/compatible-mode/v1'
|
||||
},
|
||||
description: t('model.editor.providers.aliyun.description'),
|
||||
modelTypes: ['chat', 'embedding', 'rerank', 'vllm']
|
||||
},
|
||||
{
|
||||
value: 'zhipu',
|
||||
label: t('model.editor.providers.zhipu.label'),
|
||||
defaultUrls: {
|
||||
chat: 'https://open.bigmodel.cn/api/paas/v4',
|
||||
embedding: 'https://open.bigmodel.cn/api/paas/v4/embeddings',
|
||||
vllm: 'https://open.bigmodel.cn/api/paas/v4'
|
||||
},
|
||||
description: t('model.editor.providers.zhipu.description'),
|
||||
modelTypes: ['chat', 'embedding', 'vllm']
|
||||
},
|
||||
{
|
||||
value: 'openrouter',
|
||||
label: t('model.editor.providers.openrouter.label'),
|
||||
defaultUrls: { chat: 'https://openrouter.ai/api/v1' },
|
||||
description: t('model.editor.providers.openrouter.description'),
|
||||
modelTypes: ['chat']
|
||||
},
|
||||
{
|
||||
value: 'siliconflow',
|
||||
label: t('model.editor.providers.siliconflow.label'),
|
||||
defaultUrls: {
|
||||
chat: 'https://api.siliconflow.cn/v1',
|
||||
embedding: 'https://api.siliconflow.cn/v1',
|
||||
rerank: 'https://api.siliconflow.cn/v1'
|
||||
},
|
||||
description: t('model.editor.providers.siliconflow.description'),
|
||||
modelTypes: ['chat', 'embedding', 'rerank']
|
||||
},
|
||||
{
|
||||
value: 'jina',
|
||||
label: t('model.editor.providers.jina.label'),
|
||||
defaultUrls: {
|
||||
embedding: 'https://api.jina.ai/v1',
|
||||
rerank: 'https://api.jina.ai/v1'
|
||||
},
|
||||
description: t('model.editor.providers.jina.description'),
|
||||
modelTypes: ['embedding', 'rerank']
|
||||
},
|
||||
{
|
||||
value: 'generic',
|
||||
label: t('model.editor.providers.generic.label'),
|
||||
defaultUrls: {},
|
||||
description: t('model.editor.providers.generic.description'),
|
||||
modelTypes: ['chat', 'embedding', 'rerank', 'vllm']
|
||||
},
|
||||
])
|
||||
|
||||
// 从 API 获取 Provider 列表
|
||||
const loadProviders = async () => {
|
||||
loadingProviders.value = true
|
||||
try {
|
||||
const providers = await listModelProviders(props.modelType)
|
||||
if (providers.length > 0) {
|
||||
apiProviderOptions.value = providers
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load providers from API, using fallback', error)
|
||||
} finally {
|
||||
loadingProviders.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 根据当前模型类型过滤的 Provider 列表
|
||||
const providerOptions = computed(() => {
|
||||
// 优先使用 API 返回的数据
|
||||
if (apiProviderOptions.value.length > 0) {
|
||||
return apiProviderOptions.value
|
||||
}
|
||||
// 回退到硬编码值,按 modelTypes 过滤
|
||||
return fallbackProviderOptions.value.filter(p =>
|
||||
p.modelTypes.includes(props.modelType)
|
||||
)
|
||||
})
|
||||
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emit('update:visible', val)
|
||||
@@ -300,6 +428,7 @@ const formData = ref<ModelFormData>({
|
||||
id: '',
|
||||
name: '',
|
||||
source: 'local',
|
||||
provider: 'openai',
|
||||
modelName: '',
|
||||
baseUrl: '',
|
||||
apiKey: '',
|
||||
@@ -416,6 +545,9 @@ watch(() => props.visible, (val) => {
|
||||
// 检查Ollama服务状态
|
||||
checkOllamaServiceStatus()
|
||||
|
||||
// 从 API 加载 Model Provider 列表
|
||||
loadProviders()
|
||||
|
||||
if (props.modelData) {
|
||||
formData.value = { ...props.modelData }
|
||||
} else {
|
||||
@@ -438,6 +570,7 @@ const resetForm = () => {
|
||||
id: generateId(),
|
||||
name: '', // 保留字段但不使用,保存时用 modelName
|
||||
source: 'local',
|
||||
provider: 'generic',
|
||||
modelName: '',
|
||||
baseUrl: '',
|
||||
apiKey: '',
|
||||
@@ -455,6 +588,22 @@ const resetForm = () => {
|
||||
dimensionMessage.value = ''
|
||||
}
|
||||
|
||||
// 处理厂商选择变化 (自动填充默认 URL)
|
||||
const handleProviderChange = (value: string) => {
|
||||
const provider = providerOptions.value.find(opt => opt.value === value)
|
||||
if (provider && provider.defaultUrls) {
|
||||
// 根据当前模型类型获取对应的默认 URL
|
||||
const defaultUrl = provider.defaultUrls[props.modelType]
|
||||
if (defaultUrl) {
|
||||
formData.value.baseUrl = defaultUrl
|
||||
}
|
||||
// 重置校验状态
|
||||
remoteChecked.value = false
|
||||
remoteAvailable.value = false
|
||||
remoteMessage.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
// 监听来源变化,重置校验状态(已合并到下面的 watch)
|
||||
|
||||
// 生成唯一ID
|
||||
@@ -613,7 +762,8 @@ const checkRemoteAPI = async () => {
|
||||
modelName: formData.value.modelName,
|
||||
baseUrl: formData.value.baseUrl,
|
||||
apiKey: formData.value.apiKey || '',
|
||||
dimension: formData.value.dimension
|
||||
dimension: formData.value.dimension,
|
||||
provider: formData.value.provider
|
||||
})
|
||||
// 如果测试成功且返回了维度,自动填充
|
||||
if (result.available && result.dimension) {
|
||||
@@ -1013,6 +1163,25 @@ const handleCancel = () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 厂商选择器样式
|
||||
.provider-option {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 4px 0;
|
||||
|
||||
.provider-name {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.provider-desc {
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
// 单选按钮组
|
||||
:deep(.t-radio-group) {
|
||||
display: flex;
|
||||
|
||||
@@ -1422,7 +1422,64 @@ export default {
|
||||
baseUrlRequired: 'Please enter the Base URL',
|
||||
baseUrlEmpty: 'Base URL cannot be empty',
|
||||
baseUrlInvalid: 'Invalid Base URL, please enter a valid URL'
|
||||
}
|
||||
},
|
||||
// Provider related translations
|
||||
providerLabel: 'Provider',
|
||||
providerPlaceholder: 'Select model provider',
|
||||
providers: {
|
||||
openai: {
|
||||
label: 'OpenAI',
|
||||
description: 'gpt-5.2, gpt-5-mini, etc.',
|
||||
},
|
||||
aliyun: {
|
||||
label: 'Aliyun DashScope',
|
||||
description: 'qwen-plus, tongyi-embedding-vision-plus, qwen3-rerank, etc.',
|
||||
},
|
||||
zhipu: {
|
||||
label: 'Zhipu AI',
|
||||
description: 'glm-4.7, embedding-3, rerank, etc.',
|
||||
},
|
||||
openrouter: {
|
||||
label: 'OpenRouter',
|
||||
description: 'openai/gpt-5.2-chat, google/gemini-3-flash-preview, etc.',
|
||||
},
|
||||
generic: {
|
||||
label: 'Custom API',
|
||||
description: 'Generic API endpoint',
|
||||
},
|
||||
siliconflow: {
|
||||
label: 'SiliconFlow',
|
||||
description: 'deepseek-ai/DeepSeek-V3.1, etc.',
|
||||
},
|
||||
jina: {
|
||||
label: 'Jina AI',
|
||||
description: 'jina-clip-v1, jina-embeddings-v2-base-zh, etc.',
|
||||
},
|
||||
volcengine: {
|
||||
label: 'Volcengine',
|
||||
description: 'doubao-1-5-pro-32k-250115, doubao-embedding-vision-250615, etc.',
|
||||
},
|
||||
deepseek: {
|
||||
label: 'DeepSeek',
|
||||
description: 'deepseek-chat, deepseek-reasoner, etc.',
|
||||
},
|
||||
hunyuan: {
|
||||
label: 'Hunyuan',
|
||||
description: 'hunyuan-pro, hunyuan-standard, hunyuan-embedding, etc.',
|
||||
},
|
||||
minimax: {
|
||||
label: 'MiniMax',
|
||||
description: 'MiniMax-M2.1, MiniMax-M2.1-lightning, etc.',
|
||||
},
|
||||
mimo: {
|
||||
label: 'MiMo',
|
||||
description: 'mimo-v2-flash',
|
||||
},
|
||||
gemini: {
|
||||
label: 'Google Gemini',
|
||||
description: 'gemini-3-flash-preview, gemini-2.5-pro, etc.',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
language: {
|
||||
@@ -1453,7 +1510,7 @@ export default {
|
||||
ragQandA: 'RAG Intelligent Q&A',
|
||||
independentTenant: 'Independent Tenant Space',
|
||||
fullApiAccess: 'Full API Access',
|
||||
knowledgeBaseManagement: 'Knowledge Base Management',
|
||||
knowledgeBaseManagement: 'Knowledge Base Management',
|
||||
carousel: {
|
||||
agenticRagTitle: 'Agentic RAG',
|
||||
agenticRagDesc: 'Query rewriting + smart recall + re-ranking',
|
||||
|
||||
@@ -889,7 +889,64 @@ export default {
|
||||
baseUrlRequired: 'Введите Base URL',
|
||||
baseUrlEmpty: 'Base URL не может быть пустым',
|
||||
baseUrlInvalid: 'Недопустимый Base URL, введите корректный адрес'
|
||||
}
|
||||
},
|
||||
// Переводы для провайдеров
|
||||
providerLabel: 'Провайдер',
|
||||
providerPlaceholder: 'Выберите провайдера модели',
|
||||
providers: {
|
||||
openai: {
|
||||
label: 'OpenAI',
|
||||
description: 'gpt-5.2, gpt-5-mini, etc.',
|
||||
},
|
||||
aliyun: {
|
||||
label: 'Aliyun DashScope',
|
||||
description: 'qwen-plus, tongyi-embedding-vision-plus, qwen3-rerank, etc.',
|
||||
},
|
||||
zhipu: {
|
||||
label: 'Zhipu AI',
|
||||
description: 'glm-4.7, embedding-3, rerank, etc.',
|
||||
},
|
||||
openrouter: {
|
||||
label: 'OpenRouter',
|
||||
description: 'openai/gpt-5.2-chat, google/gemini-3-flash-preview, etc.',
|
||||
},
|
||||
generic: {
|
||||
label: 'Пользовательский API',
|
||||
description: 'Generic API endpoint',
|
||||
},
|
||||
siliconflow: {
|
||||
label: 'SiliconFlow',
|
||||
description: 'deepseek-ai/DeepSeek-V3.1, etc.',
|
||||
},
|
||||
jina: {
|
||||
label: 'Jina AI',
|
||||
description: 'jina-clip-v1, jina-embeddings-v2-base-zh, etc.',
|
||||
},
|
||||
volcengine: {
|
||||
label: 'Volcengine',
|
||||
description: 'doubao-1-5-pro-32k-250115, doubao-embedding-vision-250615, etc.',
|
||||
},
|
||||
deepseek: {
|
||||
label: 'DeepSeek',
|
||||
description: 'deepseek-chat, deepseek-reasoner, etc.',
|
||||
},
|
||||
hunyuan: {
|
||||
label: 'Hunyuan',
|
||||
description: 'hunyuan-pro, hunyuan-standard, hunyuan-embedding, etc.',
|
||||
},
|
||||
minimax: {
|
||||
label: 'MiniMax',
|
||||
description: 'MiniMax-M2.1, MiniMax-M2.1-lightning, etc.',
|
||||
},
|
||||
mimo: {
|
||||
label: 'MiMo',
|
||||
description: 'mimo-v2-flash',
|
||||
},
|
||||
gemini: {
|
||||
label: 'Google Gemini',
|
||||
description: 'gemini-3-flash-preview, gemini-2.5-pro, etc.',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
createChat: {
|
||||
|
||||
@@ -982,6 +982,39 @@ export default {
|
||||
baseUrlEmpty: "Base URL 不能为空",
|
||||
baseUrlInvalid: "Base URL 格式不正确,请输入有效的 URL",
|
||||
},
|
||||
// Provider (厂商) 相关翻译
|
||||
providerLabel: "服务商",
|
||||
providerPlaceholder: "选择模型服务商",
|
||||
providers: {
|
||||
openai: {
|
||||
label: "OpenAI",
|
||||
description: "OpenAI 官方 API",
|
||||
},
|
||||
aliyun: {
|
||||
label: "阿里云 DashScope",
|
||||
description: "支持 Qwen、DeepSeek 等模型",
|
||||
},
|
||||
zhipu: {
|
||||
label: "智谱 AI",
|
||||
description: "支持 GLM-4 系列模型",
|
||||
},
|
||||
openrouter: {
|
||||
label: "OpenRouter",
|
||||
description: "多模型聚合平台",
|
||||
},
|
||||
generic: {
|
||||
label: "自定义 API",
|
||||
description: "OpenAI 兼容的自定义端点",
|
||||
},
|
||||
siliconflow: {
|
||||
label: "SiliconFlow",
|
||||
description: "硅基流动,支持多种模型",
|
||||
},
|
||||
jina: {
|
||||
label: "Jina AI",
|
||||
description: "专注于 Embedding 和 Rerank",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
language: {
|
||||
@@ -1154,9 +1187,9 @@ export default {
|
||||
messages: {
|
||||
deleted: "已删除",
|
||||
deleteFailed: "删除失败",
|
||||
file: "文件",
|
||||
knowledgeBase: "知识库",
|
||||
noResult: "无结果",
|
||||
file: "文件",
|
||||
knowledgeBase: "知识库",
|
||||
noResult: "无结果",
|
||||
},
|
||||
features: {
|
||||
knowledgeGraph: "已启用知识图谱",
|
||||
|
||||
@@ -290,6 +290,7 @@ function convertToLegacyFormat(model: ModelConfig) {
|
||||
modelName: model.name, // 显示名称作为模型名
|
||||
baseUrl: model.parameters.base_url || '',
|
||||
apiKey: model.parameters.api_key || '',
|
||||
provider: model.parameters.provider || '', // 添加 provider 字段
|
||||
dimension: model.parameters.embedding_parameters?.dimension,
|
||||
isBuiltin: model.is_builtin || false
|
||||
}
|
||||
@@ -400,6 +401,7 @@ const handleModelSave = async (modelData: any) => {
|
||||
parameters: {
|
||||
base_url: modelData.baseUrl?.trim() || '',
|
||||
api_key: modelData.apiKey?.trim() || '',
|
||||
provider: modelData.provider || '', // 添加 provider 字段
|
||||
...(currentModelType.value === 'embedding' && modelData.dimension ? {
|
||||
embedding_parameters: {
|
||||
dimension: modelData.dimension,
|
||||
|
||||
Reference in New Issue
Block a user