@@ -474,8 +474,8 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
474
474
<div>🎉 等待结果并查看详细报告</div>
475
475
<div>🕵️ 使用“官转验证”功能确认API的真实性</div>
476
476
<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>
479
479
</ul>
480
480
<br>
481
481
<p><strong>版本历史:</strong></p>
@@ -864,35 +864,45 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
864
864
'<td class="td2"><span class="copy-btn2"" onclick="copyText(\'' + r . model + '\')">' + r . model + '</span></td>' +
865
865
'<td class="td3">' + r . responseTime . toFixed ( 2 ) + '</td>'
866
866
867
- let verifyButtons = '' ;
867
+ let verifyButtons = `
868
+ <button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${ r . model } ')">
869
+ 函数验证
870
+ </button>
871
+ ` ;
868
872
if ( r . model . startsWith ( 'gpt-' ) || r . model . startsWith ( 'claude-' ) ) {
869
873
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
+ ` ;
884
884
}
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>` ;
886
886
} ) ;
887
887
888
888
results . inconsistent . forEach ( function ( r ) {
889
889
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
+ ` ;
896
906
} ) ;
897
907
898
908
results . invalid . forEach ( function ( r ) {
@@ -1269,13 +1279,14 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
1269
1279
layui . use ( 'layer' , function ( ) {
1270
1280
const layer = layui . layer ;
1271
1281
layer . closeAll ( 'loading' ) ;
1272
- const title = '<b><span style="color: black;">模型函数调用响应对比</span></b>' ;
1282
+ const title = '<b><span style="color: black;">模型函数调用响应对比(非openai模型的函数调用响应可能有差异,但肉眼可辨) </span></b>' ;
1273
1283
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>' ;
1276
1287
}
1277
1288
else {
1278
- text = '<b><span style="color: green ;">模型返回了函数调用响应 ,测试模型为:' + model + '</span></b>' ;
1289
+ text = '<b><span style="color: red ;">模型无函数调用响应返回 ,测试模型为:' + model + '</span></b>' ;
1279
1290
}
1280
1291
const referenceFunctionCall = JSON . stringify ( {
1281
1292
"index" : 0 ,
@@ -1295,7 +1306,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
1295
1306
<table border="1" style="width: 100%; border-collapse: collapse; text-align: left;">
1296
1307
<thead>
1297
1308
<tr>
1298
- <th style="padding: 8px; background-color: #f2f2f2;">标准输出参考</th>
1309
+ <th style="padding: 8px; background-color: #f2f2f2;">OpenAI 标准输出参考</th>
1299
1310
<th style="padding: 8px; background-color: #f2f2f2;">测试模型输出</th>
1300
1311
</tr>
1301
1312
</thead>
0 commit comments