fix(compute): 语音识别预置可用化并更新预设数据至 v135 (#128)

百炼 paraformer-v2 与本地 Whisper 的预置没有语音协议,解析报 missing_model_profile,用户选了也用不了。

- 百炼预置改用 fun-asr-realtime,paraformer-v2 只接受公网 URL,移出接入面并写入 tombstones,规格保留。
- 本地 Whisper 绑定独立规格 whisper-large-v3,声明 credentialMode: none;该字段只进 V1 投影,已发布客户端的 V2 连接 Schema 不接受。
- OpenAI 新增 gpt-transcribe,whisper-1 记录 2027-02-26 停服并暂留。
- 同步官方来源、模型与平台指纹、适配与规格决策记录、来源缺口清单和回归测试。
This commit is contained in:
yige authored and GitHub committed 2026-11-01 17:58:04 +08:00
1 parent 30f65178cc
commit 3046afb9ca
47 files changed
+1512 -409

No files matched your search

+3 -3
View File
@@ -95,15 +95,15 @@ test('explicit access-local/dynamic contracts stay callable on known adapters bu
assert.ok(resolveEffectiveModel(spec,m,{...options,connection:{apiFormat:'not-implemented'}}).blockedReasons.includes('unknown-adapter'));
}
});
test('all 36 confirmed unimplemented native models remain visible and cannot call or auto route',()=>{
test('all 34 confirmed unimplemented native models remain visible and cannot call or auto route',()=>{
const decisions=JSON.parse(fs.readFileSync(path.join(root,'docs/plans/catalog-contract-migration/ADAPTER-DECISIONS.json'),'utf8')).decisions;
assert.equal(decisions.length,36);let count=0;
assert.equal(decisions.length,34);let count=0;
for(const decision of decisions){
const access=catalog.accesses.find(a=>a.metadata.sourceFile===decision.file),m=access.models.find(m=>m.apiModelId===decision.apiModelId),s=catalog.specs.find(s=>s.modelRef===m.modelRef);
assert.equal(m.protocol.state,'unsupported',`${decision.file}:${m.apiModelId}`);assert.ok(m.protocol.reason);assert.equal(m.protocol.requiredClientVersion,undefined);
const result=resolveEffectiveModel(s,m,{...options,connection:access.connection});assert.equal(result.eligibleForCall,false);assert.equal(result.eligibleForAutoRouting,false);assert.ok(result.blockedReasons.includes('unsupported-adapter'));count++;
}
assert.equal(count,36);
assert.equal(count,34);
});
test('actual outgoing aliases survive canonical transport IDs and V1 projection',()=>{
const expected={ 'glm-5.2':'glm-5.2[1m]','doubao-seed-2.1-pro':'doubao-seed-2-1-pro-260628','doubao-seed-2.1-turbo':'doubao-seed-2-1-turbo-260628'};
+1 -1
View File
@@ -19,7 +19,7 @@ test('identity-only coding variants cannot inherit family context, output or rou
})
test('all recorded baseline differences and exceptions have explicit decisions',()=>{
const d=read('docs/plans/catalog-contract-migration/SPEC-DECISIONS.json')
assert.equal(d.bindings.length,24);assert.equal(d.differences.length,45);assert.equal(d.specOnly.length,58)
assert.equal(d.bindings.length,24);assert.equal(d.differences.length,45);assert.equal(d.specOnly.length,59)
for(const row of [...d.differences,...d.specOnly]){assert.ok(row.classification);assert.ok(row.decision);assert.ok(row.reason)}
for(const row of d.accessExceptions){assert.equal(row.inheritFamily,false);assert.equal(row.automaticRouting,false);assert.equal(row.effectiveBinding,null)}
assert.ok(d.differences.some(r=>r.id==='gpt-5.4-nano'&&!r.currentDifferences.length))
@@ -176,3 +176,55 @@ test('Mistral original unknown budgets stay unknown rather than inheriting the g
assert.equal(hosted.facts.contextWindow, 1048576)
assert.equal(hosted.facts.maxOutputTokens, 262144)
})
test('ASR presets declare the protocol their client adapter implements', () => {
const specs = {
'fun-asr-realtime': read('compute/model-specs/qwen.json').specs.find(item => item.id === 'fun-asr-realtime'),
'gpt-transcribe': read('compute/model-specs/openai.json').specs.find(item => item.id === 'gpt-transcribe'),
'whisper-large-v3': read('compute/model-specs/openai.json').specs.find(item => item.id === 'whisper-large-v3'),
}
const protocols = { 'fun-asr-realtime': 'dashscope-websocket-asr', 'gpt-transcribe': 'openai-audio-transcriptions', 'whisper-large-v3': 'openai-audio-transcriptions' }
for (const [id, spec] of Object.entries(specs)) {
assert.deepEqual(spec.match.exact, [id], '只精确匹配,不能经 family 把协议扩散到其他型号')
assert.deepEqual(spec.spec.serviceType, ['asr'])
assert.equal(spec.spec.extra.modelOrigin.canonicalModelId, id)
assert.equal(spec.spec.extra.speech.protocol, protocols[id])
assert.equal(spec.spec.extra.speech.protocolVersion, '1')
assert.equal(spec.routing, undefined, '语音模型不进入 Agent 自动路由')
}
// 客户端解析实时听写要求 PCM16/16k 流式;整段识别要求 wav。
assert.deepEqual(specs['fun-asr-realtime'].spec.extra.speech.modes, ['batch', 'streaming'])
assert.deepEqual(specs['fun-asr-realtime'].spec.extra.speech.sampleRates, [16000])
for (const spec of Object.values(specs)) assert.ok(spec.spec.extra.speech.inputFormats.includes('wav'))
// gpt-transcribe 用 languages 取代 language,协议 v1 发不了,声明不接受语言提示。
assert.equal(specs['gpt-transcribe'].spec.extra.speech.languageHints, false)
assert.equal(specs['whisper-large-v3'].spec.extra.speech.languageHints, true)
})
test('Paraformer leaves the DashScope preset while its spec stays, because it only accepts public URLs', () => {
const provider = read('compute/providers/dashscope.json')
assert.equal(provider.models.some(item => item.modelName === 'paraformer-v2'), false)
assert.ok(provider.tombstones.includes('paraformer-v2'))
assert.ok(provider.models.some(item => item.modelName === 'fun-asr-realtime'))
assert.ok(read('compute/model-specs/qwen.json').specs.some(item => item.id === 'paraformer-v2'))
})
test('Whisper-1 stays selectable in V1 until its announced shutdown', () => {
const provider = read('compute/providers/openai.json')
assert.ok(provider.models.some(item => item.modelName === 'whisper-1'))
assert.ok(provider.models.some(item => item.modelName === 'gpt-transcribe'))
const catalog = read('catalog/v2/catalog.json')
const lifecycle = catalog.specs.find(item => item.modelRef === 'openai:whisper-1').lifecycle
assert.equal(lifecycle.status, 'deprecated')
assert.equal(lifecycle.retiredAt, '2027-02-26')
})
test('credentialMode reaches V1 only: released clients reject unknown V2 connection keys', () => {
assert.equal(read('compute/providers/local-whisper.json').credentialMode, 'none')
for (const path of ['catalog/v2/catalog.json', 'compute/v2/catalog.json']) {
const access = read(path).accesses.find(item => item.id === 'provider-local-whisper')
assert.equal(access.connection.credentialMode, undefined, path)
}
const compiled = read('compute/v2/catalog.json')
assert.equal(compiled.accesses.some(item => item.metadata.v1Connection !== undefined), false)
const schema = read('schemas/catalog-v2.schema.json')
const connection = schema.properties.accesses.items.properties.connection
assert.equal(connection.additionalProperties, false)
assert.equal(connection.properties.credentialMode, undefined, '放宽前先确认客户端 Schema 已接受并铺开')
})