Skip to content

Commit 3361f3e

Browse files
Add GPT-5 ~ GPT-5.4 stable models
Add built-in ChatGPT API presets for gpt-5, gpt-5.1, gpt-5.2, and gpt-5.4 alongside the existing chat-latest entries.
1 parent 5b40e78 commit 3361f3e

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/config/index.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ export const chatgptApiModelKeys = [
5151
'chatgptApi35_0125',
5252
'chatgptApi4o_128k',
5353
'chatgptApi5Latest',
54+
'chatgptApi5',
5455
'chatgptApi5_1Latest',
56+
'chatgptApi5_1',
5557
'chatgptApi5_2Latest',
58+
'chatgptApi5_2',
5659
'chatgptApi5_3Latest',
60+
'chatgptApi5_4',
5761
'chatgptApi4oMini',
5862
'chatgptApi4_8k',
5963
'chatgptApi4_8k_0613',
@@ -246,9 +250,13 @@ export const Models = {
246250
desc: 'ChatGPT (GPT-4-Turbo 128k 0125 Preview)',
247251
},
248252
chatgptApi5Latest: { value: 'gpt-5-chat-latest', desc: 'ChatGPT (ChatGPT-5 latest)' },
253+
chatgptApi5: { value: 'gpt-5', desc: 'ChatGPT (GPT-5)' },
249254
chatgptApi5_1Latest: { value: 'gpt-5.1-chat-latest', desc: 'ChatGPT (ChatGPT-5.1 latest)' },
255+
chatgptApi5_1: { value: 'gpt-5.1', desc: 'ChatGPT (GPT-5.1)' },
250256
chatgptApi5_2Latest: { value: 'gpt-5.2-chat-latest', desc: 'ChatGPT (ChatGPT-5.2 latest)' },
257+
chatgptApi5_2: { value: 'gpt-5.2', desc: 'ChatGPT (GPT-5.2)' },
251258
chatgptApi5_3Latest: { value: 'gpt-5.3-chat-latest', desc: 'ChatGPT (ChatGPT-5.3 latest)' },
259+
chatgptApi5_4: { value: 'gpt-5.4', desc: 'ChatGPT (GPT-5.4)' },
252260

253261
chatgptApi4_1: { value: 'gpt-4.1', desc: 'ChatGPT (GPT-4.1)' },
254262
chatgptApi4_1_mini: { value: 'gpt-4.1-mini', desc: 'ChatGPT (GPT-4.1 mini)' },

tests/unit/config/config-predicates.test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ test('getNavigatorLanguage treats zh-Hant locale as zhHant', () => {
6565

6666
test('isUsingChatgptApiModel detects chatgpt API models and excludes custom model', () => {
6767
assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi4oMini' }), true)
68+
assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5' }), true)
69+
assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_1' }), true)
70+
assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_2' }), true)
71+
assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_4' }), true)
6872
assert.equal(isUsingChatgptApiModel({ modelName: 'customModel' }), false)
6973
})
7074

tests/unit/utils/model-name-convert.test.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ test('modelNameToDesc returns desc for a known model name without t function', (
117117
assert.equal(desc, 'ChatGPT (Web)')
118118
})
119119

120+
test('modelNameToDesc returns desc for GPT-5 stable presets', () => {
121+
assert.equal(modelNameToDesc('chatgptApi5'), 'ChatGPT (GPT-5)')
122+
assert.equal(modelNameToDesc('chatgptApi5_1'), 'ChatGPT (GPT-5.1)')
123+
assert.equal(modelNameToDesc('chatgptApi5_2'), 'ChatGPT (GPT-5.2)')
124+
assert.equal(modelNameToDesc('chatgptApi5_4'), 'ChatGPT (GPT-5.4)')
125+
})
126+
120127
test('modelNameToDesc appends extraCustomModelName for customModel', () => {
121128
const desc = modelNameToDesc('customModel', null, 'my-gpt')
122129
assert.equal(desc, 'Custom Model (my-gpt)')

0 commit comments

Comments
 (0)