fix(frontend): test selected model provider only
This commit is contained in:
@@ -571,11 +571,10 @@ const filteredProviders = computed(() => {
|
||||
const activeProvider = computed<ProviderView>(
|
||||
() => providers.value.find((item) => item.providerCode === selectedProviderCode.value) ?? providers.value[0] ?? seedProviders[0]
|
||||
);
|
||||
const activeChatModel = computed(
|
||||
() =>
|
||||
modelRows.value.find((item) => item.category === 'chat' && item.enabled && item.configured) ??
|
||||
modelRows.value.find((item) => item.category === 'chat' && item.enabled) ??
|
||||
modelRows.value[0]
|
||||
const activeChatModel = computed(() =>
|
||||
modelRows.value.find(
|
||||
(item) => item.id > 0 && item.providerCode === selectedProviderCode.value && item.category === 'chat' && item.enabled && item.configured
|
||||
)
|
||||
);
|
||||
const keyText = computed(() => {
|
||||
if (!activeProvider.value.configured) return '未配置';
|
||||
@@ -681,6 +680,10 @@ const runVectorRebuild = async () => {
|
||||
};
|
||||
|
||||
const runConnectionTest = async () => {
|
||||
if (!activeChatModel.value) {
|
||||
ElMessage.warning('请先为当前供应商配置并启用 chat 模型');
|
||||
return;
|
||||
}
|
||||
testing.value = true;
|
||||
try {
|
||||
const result = await testModelChat({
|
||||
|
||||
Reference in New Issue
Block a user