Skip to content

Commit 89b8647

Browse files
committed
FC作为功能性测试,对所有可用模型都开放
1 parent e1bf584 commit 89b8647

File tree

1 file changed

+40
-29
lines changed

1 file changed

+40
-29
lines changed

index.html

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
474474
<div>🎉 等待结果并查看详细报告</div>
475475
<div>🕵️ 使用“官转验证”功能确认API的真实性</div>
476476
<div>🕵️‍♀️ 使用“温度验证”功能确认API的真实性</div>
477-
<div>📊 使用“函数验证”功能确认API的真实性</div>
478-
<div>🔒 <strong>beta 功能:增加本地缓存API信息功能,数据仅本地保留</strong> </div>
477+
<div>📊 使用“函数验证”功能检测API是否支持FC</div>
478+
<div>🔒 <strong> beta 功能:支持本地缓存API信息,数据仅本地保留,默认关闭</strong> </div>
479479
</ul>
480480
<br>
481481
<p><strong>版本历史:</strong></p>
@@ -864,35 +864,45 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
864864
'<td class="td2"><span class="copy-btn2"" onclick="copyText(\'' + r.model + '\')">' + r.model + '</span></td>' +
865865
'<td class="td3">' + r.responseTime.toFixed(2) + '</td>'
866866

867-
let verifyButtons = '';
867+
let verifyButtons = `
868+
<button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${r.model}')">
869+
函数验证
870+
</button>
871+
`;
868872
if (r.model.startsWith('gpt-') || r.model.startsWith('claude-')) {
869873
let officialButtonClass = results.awaitOfficialVerification.some(item => item.model === r.model) ? "green" : "yellow";
870-
verifyButtons =
871-
'<button class="verify-btn blue" data-tooltip="低温度参数下预测序列下一个值,将发起4次请求" onclick="verifyTemperature(\'' +
872-
r.model +
873-
"')\">温度验证</button>" +
874-
(r.model.startsWith('gpt-') ?
875-
'<button class="verify-btn ' +
876-
officialButtonClass +
877-
'" data-tooltip="相同种子参数下校验回复相似性和系统指纹,将发起4次请求" onclick="verifyOfficial(\'' +
878-
r.model +
879-
"')\">官转验证</button>" : '') +
880-
(r.model.startsWith('gpt-') ?
881-
'<button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling(\'' +
882-
r.model +
883-
"')\">函数验证</button>" : '');
874+
verifyButtons += `
875+
<button class="verify-btn blue" data-tooltip="低温度参数下预测序列下一个值,将发起4次请求" onclick="verifyTemperature('${r.model}')">
876+
温度验证
877+
</button>
878+
${r.model.startsWith('gpt-') ? `
879+
<button class="verify-btn ${officialButtonClass}" data-tooltip="相同种子参数下校验回复相似性和系统指纹,将发起4次请求" onclick="verifyOfficial('${r.model}')">
880+
官转验证
881+
</button>
882+
` : ''}
883+
`;
884884
}
885-
content += '<td class="td4"><div class="verify-btn-group">' + verifyButtons + '</div></td>'
885+
content += `<td class="td4"><div class="verify-btn-group">${verifyButtons}</div></td>`;
886886
});
887887

888888
results.inconsistent.forEach(function (r) {
889889

890-
content += '<tr>' +
891-
'<td class="td1 td1-no" >模型不一致/映射,tnnd掺假?</td>' +
892-
'<td class="td2"><span class="copy-btn2"" onclick="copyText(\'' + r.model + '\')">' + r.model + '</span></td>' +
893-
'<td class="td3">' + r.responseTime.toFixed(2) + '</td>' +
894-
'<td class="td4">' + (r.returnedModel ? '返回模型: ' + r.returnedModel : '该接口未返回模型名称') + '</td>' +
895-
'</tr>';
890+
content += `
891+
<tr>
892+
<td class="td1 td1-no" >模型不一致/映射,tnnd掺假?</td>
893+
<td class="td2">
894+
<span class="copy-btn2"" onclick="copyText('${r.model}')">${r.model}</span>
895+
</td>
896+
<td class="td3">${r.responseTime.toFixed(2)}</td>
897+
<td class="td4">
898+
<button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${r.model}')">
899+
函数验证
900+
</button>
901+
<br>
902+
${r.returnedModel ? '返回模型: ' + r.returnedModel : '该接口未返回模型名称'}
903+
</td>
904+
</tr>
905+
`;
896906
});
897907

898908
results.invalid.forEach(function (r) {
@@ -1269,13 +1279,14 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
12691279
layui.use('layer', function () {
12701280
const layer = layui.layer;
12711281
layer.closeAll('loading');
1272-
const title = '<b><span style="color: black;">模型函数调用响应对比</span></b>';
1282+
const title = '<b><span style="color: black;">模型函数调用响应对比(非openai模型的函数调用响应可能有差异,但肉眼可辨)</span></b>';
12731283
let text;
1274-
if(result.choices?.[0]?.finish_reason !== 'function_call'){
1275-
text = '<b><span style="color: red;">模型无函数调用响应返回,测试模型为:' + model + '</span></b>';
1284+
// 第一种是 openai 的函数调用响应,第二种是经 oneapi 中转后 gemini 的函数调用响应,目前手里只有这两种支持 FC
1285+
if(result.choices?.[0]?.finish_reason === 'function_call' || result.choices?.[0]?.message?.tool_calls?.[0]?.type === "function"){
1286+
text = '<b><span style="color: green;">模型返回了函数调用响应,测试模型为:' + model + '</span></b>';
12761287
}
12771288
else{
1278-
text = '<b><span style="color: green;">模型返回了函数调用响应,测试模型为:' + model + '</span></b>';
1289+
text = '<b><span style="color: red;">模型无函数调用响应返回,测试模型为:' + model + '</span></b>';
12791290
}
12801291
const referenceFunctionCall = JSON.stringify({
12811292
"index": 0,
@@ -1295,7 +1306,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
12951306
<table border="1" style="width: 100%; border-collapse: collapse; text-align: left;">
12961307
<thead>
12971308
<tr>
1298-
<th style="padding: 8px; background-color: #f2f2f2;">标准输出参考</th>
1309+
<th style="padding: 8px; background-color: #f2f2f2;">OpenAI 标准输出参考</th>
12991310
<th style="padding: 8px; background-color: #f2f2f2;">测试模型输出</th>
13001311
</tr>
13011312
</thead>

0 commit comments

Comments
 (0)