已配置模型显示id的bug修复
This commit is contained in:
@@ -373,12 +373,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
container.innerHTML = selectedModelIds.map((modelId, index) => {
|
container.innerHTML = selectedModelIds.map((modelId, index) => {
|
||||||
const model = allAvailableModels.find(m => m.id === modelId);
|
// 支持 ID 数字或模型名称字符串匹配
|
||||||
|
const model = allAvailableModels.find(m =>
|
||||||
|
String(m.id) === String(modelId) || m.name === modelId
|
||||||
|
);
|
||||||
const colors = ['bg-blue-100 text-blue-700 border-blue-200', 'bg-green-100 text-green-700 border-green-200', 'bg-purple-100 text-purple-700 border-purple-200', 'bg-orange-100 text-orange-700 border-orange-200'];
|
const colors = ['bg-blue-100 text-blue-700 border-blue-200', 'bg-green-100 text-green-700 border-green-200', 'bg-purple-100 text-purple-700 border-purple-200', 'bg-orange-100 text-orange-700 border-orange-200'];
|
||||||
const colorClass = colors[index % colors.length];
|
const colorClass = colors[index % colors.length];
|
||||||
return `
|
return `
|
||||||
<span class="model-tag px-3 py-1.5 rounded-lg text-sm font-medium flex items-center ${colorClass}">
|
<span class="model-tag px-3 py-1.5 rounded-lg text-sm font-medium flex items-center ${colorClass}">
|
||||||
${model?.name || `模型 ${modelId}`}
|
${model?.name || modelId}
|
||||||
</span>
|
</span>
|
||||||
`;
|
`;
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|||||||
@@ -275,7 +275,10 @@
|
|||||||
const contentText = showLoading ? '<span class="text-gray-400">正在调用模型API...</span>' : '<span class="text-gray-300">模型即将开始生成回答...</span>';
|
const contentText = showLoading ? '<span class="text-gray-400">正在调用模型API...</span>' : '<span class="text-gray-300">模型即将开始生成回答...</span>';
|
||||||
|
|
||||||
grid.innerHTML = displayModelIds.map((modelId, index) => {
|
grid.innerHTML = displayModelIds.map((modelId, index) => {
|
||||||
const model = allAvailableModels.find(m => m.id === modelId) || { name: `模型 ${modelId}` };
|
// 支持 ID 数字或模型名称字符串匹配
|
||||||
|
const model = allAvailableModels.find(m =>
|
||||||
|
m.id == modelId || m.id === modelId || m.name === modelId
|
||||||
|
) || { name: modelId };
|
||||||
const colors = ['bg-blue-100 text-blue-700', 'bg-green-100 text-green-700', 'bg-purple-100 text-purple-700', 'bg-orange-100 text-orange-700'];
|
const colors = ['bg-blue-100 text-blue-700', 'bg-green-100 text-green-700', 'bg-purple-100 text-purple-700', 'bg-orange-100 text-orange-700'];
|
||||||
const colorClass = colors[index % colors.length];
|
const colorClass = colors[index % colors.length];
|
||||||
return `
|
return `
|
||||||
|
|||||||
Reference in New Issue
Block a user