fix(aihr): model test picks seed placeholder name and misses db config

前端测试对话发的是合并列表里 seed 占位行的模型名(gpt-4o-mini),后端
按该名查库落空即判未配置返回 seed fallback。后端:请求模型名不存在时
回退默认已启用 chat 配置,且运行参数就绪后以解析出的模型名调用供应商;
前端:优先选 enabled 且 configured 的库行作为当前 chat 模型。
This commit is contained in:
2026-07-03 21:31:03 +08:00
parent 8ead250025
commit be136dc9f9
2 changed files with 14 additions and 3 deletions
+6 -1
View File
@@ -471,7 +471,12 @@ 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) ?? modelRows.value[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 keyText = computed(() => {
if (!activeProvider.value.configured) return '未配置';
return showKey.value ? '已配置,接口不回传密钥' : 'sk-************';