@@ -733,7 +733,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
733
733
734
734
async function testModel ( model ) {
735
735
const controller = new AbortController ( ) ;
736
- const id = setTimeout ( ( ) => controller . abort ( ) , timeout ) ;
736
+ const id = setTimeout ( ( ) => controller . abort ( ) , model . startsWith ( 'o1-' ) ? timeout * 6 : timeout ) ;
737
737
const startTime = Date . now ( ) ;
738
738
739
739
let response_text ;
@@ -742,7 +742,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
742
742
model : model ,
743
743
messages : [ { role : "user" , content : "写一个10个字的冷笑话" } ]
744
744
} ;
745
- if ( / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( model ) ) {
745
+ if ( / ^ ( g p t - | c h a t g p t - ) / . test ( model ) ) {
746
746
requestBody . seed = 331 ;
747
747
}
748
748
const response = await fetch ( `${ apiUrl } /v1/chat/completions` , {
@@ -757,13 +757,16 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
757
757
758
758
const endTime = Date . now ( ) ;
759
759
const responseTime = ( endTime - startTime ) / 1000 ; // 转换为秒
760
-
760
+ let has_o1_reason = false ;
761
761
if ( response . ok ) {
762
762
const data = await response . json ( ) ;
763
763
const returnedModel = data . model || "no returned model by rick" ; // 确保 returnedModel 有效
764
+ if ( returnedModel . startsWith ( "o1-" ) && data ?. usage ?. completion_tokens_details ?. reasoning_tokens > 0 ) {
765
+ has_o1_reason = true ;
766
+ }
764
767
if ( returnedModel === model ) {
765
- results . valid . push ( { model, responseTime} ) ;
766
- if ( / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( model ) ) {
768
+ results . valid . push ( { model, responseTime, has_o1_reason } ) ;
769
+ if ( / ^ ( g p t - | c h a t g p t - ) / . test ( model ) ) {
767
770
if ( data . system_fingerprint ) {
768
771
results . awaitOfficialVerification . push ( {
769
772
model,
@@ -773,7 +776,7 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
773
776
}
774
777
console . log ( `测试 API 节点:${ apiUrl } 测试模型:${ model } 模型一致,响应时间:${ responseTime . toFixed ( 2 ) } 秒` ) ;
775
778
} else {
776
- results . inconsistent . push ( { model, returnedModel, responseTime} ) ;
779
+ results . inconsistent . push ( { model, returnedModel, responseTime, has_o1_reason } ) ;
777
780
console . log ( `测试 API 节点:${ apiUrl } 测试模型:${ model } 模型不一致,期望:${ model } ,实际:${ returnedModel } ,响应时间:${ responseTime . toFixed ( 2 ) } 秒` ) ;
778
781
}
779
782
} else {
@@ -873,38 +876,48 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
873
876
'<td class="td2"><span class="copy-btn2" onclick="copyText(\'' + r . model + '\')">' + r . model + '</span></td>' +
874
877
'<td class="td3">' + r . responseTime . toFixed ( 2 ) + '</td>'
875
878
876
- let verifyButtons = `
879
+ let verifyButtons = r . model . startsWith ( 'o1-' ) ? 'o1模型不支持函数、温度、种子功能' : `
877
880
<button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${ r . model } ')">
878
881
函数验证
879
882
</button>
880
883
` ;
881
- if ( / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( r . model ) || r . model . startsWith ( 'claude-' ) ) {
884
+ if ( / ^ ( g p t - | c h a t g p t - ) / . test ( r . model ) || r . model . startsWith ( 'claude-' ) ) {
882
885
let officialButtonClass = results . awaitOfficialVerification . some ( item => item . model === r . model ) ? "green" : "yellow" ;
883
886
verifyButtons += `
884
887
<button class="verify-btn blue" data-tooltip="低温度参数下预测序列下一个值,将发起4次请求" onclick="verifyTemperature('${ r . model } ')">
885
888
温度验证
886
889
</button>
887
- ${ / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( r . model ) ? `
890
+ ${ / ^ ( g p t - | c h a t g p t - ) / . test ( r . model ) ? `
888
891
<button class="verify-btn ${ officialButtonClass } " data-tooltip="相同种子参数下校验回复相似性和系统指纹,将发起4次请求" onclick="verifyOfficial('${ r . model } ')">
889
892
官转验证
890
893
</button>
891
894
` : '' }
892
895
` ;
893
896
}
894
- content += `<td class="td4"><div class="verify-btn-group">${ verifyButtons } </div></td>` ;
897
+ let o1_response = '' ;
898
+ if ( r . model . startsWith ( 'o1-' ) ) {
899
+ if ( r . has_o1_reason ) {
900
+ o1_response = `<span style="color: green; font-weight: bold;">返回响应中包含非空 reasoning_tokens,api 可靠</span>` ;
901
+ } else {
902
+ o1_response = `<span style="color: red; font-weight: bold;">返回响应中不包含 reasoning_tokens 或为空,api 非官</span>` ;
903
+ }
904
+ }
905
+ content += `<td class="td4"><div class="verify-btn-group">${ verifyButtons } </div><br><div class="o1-response">${ o1_response } </div></td>` ;
895
906
} ) ;
896
907
897
908
results . inconsistent . forEach ( function ( r ) {
898
- let verifyButtons = `<button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${ r . model } ')">
899
- 函数验证
900
- </button>`
901
- if ( / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( r . model ) || r . model . startsWith ( 'claude-' ) ) {
909
+ let verifyButtons = r . model . startsWith ( 'o1-' ) ? 'o1模型不支持函数、温度、种子功能' : `
910
+ <button class="verify-btn cyan" data-tooltip="校验函数功能是否可用,将发起1次请求" onclick="verifyFunctionCalling('${ r . model } ')">
911
+ 函数验证
912
+ </button>
913
+ `
914
+ if ( / ^ ( g p t - | c h a t g p t - ) / . test ( r . model ) || r . model . startsWith ( 'claude-' ) ) {
902
915
let officialButtonClass = results . awaitOfficialVerification . some ( item => item . model === r . model ) ? "green" : "yellow" ;
903
916
verifyButtons += `
904
917
<button class="verify-btn blue" data-tooltip="低温度参数下预测序列下一个值,将发起4次请求" onclick="verifyTemperature('${ r . model } ')">
905
918
温度验证
906
919
</button>
907
- ${ / ^ ( g p t - | c h a t g p t - | o 1 - ) / . test ( r . model ) ? `
920
+ ${ / ^ ( g p t - | c h a t g p t - ) / . test ( r . model ) ? `
908
921
<button class="verify-btn ${ officialButtonClass } " data-tooltip="相同种子参数下校验回复相似性和系统指纹,将发起4次请求" onclick="verifyOfficial('${ r . model } ')">
909
922
官转验证
910
923
</button>
@@ -915,6 +928,15 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
915
928
if ( r . returnedModel . startsWith ( `${ r . model } -` ) ) {
916
929
highlightedReturnModel = `<span style="color: green; font-weight: bold;">${ r . model } </span>${ r . returnedModel . slice ( r . model . length ) } <br>可能是带版本号模型映射` ;
917
930
}
931
+
932
+ let o1_response = '' ;
933
+ if ( r . model . startsWith ( 'o1-' ) ) {
934
+ if ( r . has_o1_reason ) {
935
+ o1_response = `<span style="color: green; font-weight: bold;">返回响应中包含非空 reasoning_tokens,api 可靠</span>` ;
936
+ } else {
937
+ o1_response = `<span style="color: red; font-weight: bold;">返回响应中不包含 reasoning_tokens 或为空,api 非官</span>` ;
938
+ }
939
+ }
918
940
content += `
919
941
<tr>
920
942
<td class="td1 td1-no" >模型不一致/映射,tnnd掺假?</td>
@@ -926,6 +948,8 @@ <h3>(适配 oneapi/newapi 等中转格式)</h3>
926
948
${ verifyButtons }
927
949
<br>
928
950
${ r . returnedModel ? '返回模型: ' + highlightedReturnModel : '该接口未返回模型名称' }
951
+ <br>
952
+ <div class="o1-response">${ o1_response } </div>
929
953
</td>
930
954
</tr>
931
955
` ;
0 commit comments