更新账号模型白名单
This commit is contained in:
parent
0eca600ffa
commit
6681aee98d
@ -267,7 +267,7 @@ func (in *ContentModerationInput) Normalize() {
|
||||
return
|
||||
}
|
||||
in.Text = trimRunes(normalizeContentModerationText(in.Text), maxModerationInputRunes)
|
||||
in.Images = limitContentModerationImages(normalizeModerationImages(in.Images))
|
||||
in.Images = normalizeModerationImages(in.Images)
|
||||
}
|
||||
|
||||
func (in ContentModerationInput) IsEmpty() bool {
|
||||
|
||||
@ -451,7 +451,7 @@ func TestExtractContentModerationInput_OpenAIImagesIncludesPromptAndImages(t *te
|
||||
require.Equal(t, []string{"https://example.com/source.png", "data:image/png;base64,aGVsbG8="}, input.Images)
|
||||
}
|
||||
|
||||
func TestContentModerationInput_NormalizeRandomSamplesOneImageForModerationAPI(t *testing.T) {
|
||||
func TestContentModerationInput_NormalizeKeepsImagesAndModerationInputSamplesOneImage(t *testing.T) {
|
||||
images := []string{
|
||||
"data:image/png;base64,Zmlyc3Q=",
|
||||
"data:image/png;base64,c2Vjb25k",
|
||||
@ -462,9 +462,15 @@ func TestContentModerationInput_NormalizeRandomSamplesOneImageForModerationAPI(t
|
||||
}
|
||||
input.Normalize()
|
||||
|
||||
require.Len(t, input.Images, 1)
|
||||
require.Contains(t, images, input.Images[0])
|
||||
require.Len(t, input.ModerationInput(), 2)
|
||||
require.Equal(t, images, input.Images)
|
||||
|
||||
parts, ok := input.ModerationInput().([]moderationAPIInputPart)
|
||||
require.True(t, ok)
|
||||
require.Len(t, parts, 2)
|
||||
require.Equal(t, "text", parts[0].Type)
|
||||
require.Equal(t, "image_url", parts[1].Type)
|
||||
require.NotNil(t, parts[1].ImageURL)
|
||||
require.Contains(t, images, parts[1].ImageURL.URL)
|
||||
}
|
||||
|
||||
func TestBuildModerationTestInputRejectsMultipleImages(t *testing.T) {
|
||||
|
||||
@ -13,6 +13,7 @@ describe('useModelWhitelist', () => {
|
||||
expect(models).toContain('gpt-5.4')
|
||||
expect(models).toContain('gpt-5.4-mini')
|
||||
expect(models).toContain('gpt-5.4-2026-03-05')
|
||||
expect(models).toContain('codex-auto-review')
|
||||
})
|
||||
|
||||
it('openai 模型列表不再暴露已下线的 ChatGPT 登录 Codex 模型', () => {
|
||||
|
||||
@ -11,8 +11,8 @@ const openaiModels = [
|
||||
'gpt-5.5',
|
||||
// GPT-5.4 系列
|
||||
'gpt-5.4', 'gpt-5.4-mini', 'gpt-5.4-2026-03-05',
|
||||
// GPT-5.3 系列
|
||||
'gpt-5.3-codex', 'gpt-5.3-codex-spark',
|
||||
// GPT-5.3 / Codex 系列
|
||||
'gpt-5.3-codex', 'gpt-5.3-codex-spark', 'codex-auto-review',
|
||||
'gpt-4o-audio-preview', 'gpt-4o-realtime-preview',
|
||||
// GPT Image 系列
|
||||
'gpt-image-1', 'gpt-image-1.5', 'gpt-image-2'
|
||||
|
||||
@ -3210,7 +3210,7 @@ export default {
|
||||
targetNoWildcard: 'Target model cannot contain wildcard *',
|
||||
searchModels: 'Search models...',
|
||||
noMatchingModels: 'No matching models',
|
||||
fillRelatedModels: 'Fill related models',
|
||||
fillRelatedModels: 'Sync latest supported models',
|
||||
clearAllModels: 'Clear all models',
|
||||
customModelName: 'Custom model name',
|
||||
enterCustomModelName: 'Enter custom model name',
|
||||
|
||||
@ -3354,7 +3354,7 @@ export default {
|
||||
targetNoWildcard: '目标模型不能包含通配符 *',
|
||||
searchModels: '搜索模型...',
|
||||
noMatchingModels: '没有匹配的模型',
|
||||
fillRelatedModels: '填入相关模型',
|
||||
fillRelatedModels: '同步最新支持模型',
|
||||
clearAllModels: '清除所有模型',
|
||||
customModelName: '自定义模型名称',
|
||||
enterCustomModelName: '输入自定义模型名称',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user