feat(frontend): 澄清模型映射适用范围

This commit is contained in:
MMEXA
2026-07-14 00:30:39 +08:00
parent cfc4894dab
commit f10d631a9c
11 changed files with 657 additions and 111 deletions
@@ -50,9 +50,11 @@ describe('api format display helpers', () => {
])
})
it('applies Responses to Search permissions in one direction', () => {
it('applies Responses companion permissions in one direction', () => {
expect(apiFormatPermissionCovers('OPENAI_RESPONSES', 'openai:search')).toBe(true)
expect(apiFormatPermissionCovers('OPENAI_RESPONSES', 'openai:responses:compact')).toBe(true)
expect(apiFormatPermissionCovers('openai:search', 'openai:responses')).toBe(false)
expect(apiFormatPermissionCovers('openai:responses:compact', 'openai:responses')).toBe(false)
})
it('formats embedding api format ids distinctly from chat formats', () => {
@@ -235,7 +235,9 @@ export function apiFormatPermissionCovers(
return Boolean(allowed)
&& Boolean(requested)
&& (allowed === requested
|| (allowed === API_FORMATS.OPENAI_RESPONSES && requested === API_FORMATS.OPENAI_SEARCH))
|| (allowed === API_FORMATS.OPENAI_RESPONSES
&& (requested === API_FORMATS.OPENAI_RESPONSES_COMPACT
|| requested === API_FORMATS.OPENAI_SEARCH)))
}
// 工具函数:按 family 分组并排序 API 格式数组