Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 123 additions & 43 deletions modules/model/provider/OpenAI/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,102 @@
import { ModelTypeEnum, type ProviderConfigType } from '../../type';

const ttsVoices = [
{
label: 'Alloy',
value: 'alloy'
},
{
label: 'Ash',
value: 'ash'
},
{
label: 'Ballad',
value: 'ballad'
},
{
label: 'Coral',
value: 'coral'
},
{
label: 'Echo',
value: 'echo'
},
{
label: 'Fable',
value: 'fable'
},
{
label: 'Nova',
value: 'nova'
},
{
label: 'Onyx',
value: 'onyx'
},
{
label: 'Sage',
value: 'sage'
},
{
label: 'Shimmer',
value: 'shimmer'
},
{
label: 'Verse',
value: 'verse'
},
{
label: 'Marin',
value: 'marin'
},
{
label: 'Cedar',
value: 'cedar'
}
];

const legacyTtsVoices = ttsVoices.filter(
({ value }) => !['ballad', 'verse', 'marin', 'cedar'].includes(value)
Comment on lines +58 to +59
);

const models: ProviderConfigType = {
provider: 'OpenAI',
list: [
{
type: ModelTypeEnum.llm,
model: 'gpt-5.5',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid registering unpublished OpenAI model IDs

When this provider list is returned from initModels, users can select this new preset, but OpenAI's current public model catalog lists gpt-5.2/gpt-5.2-pro as the latest GPT-5 models and does not expose gpt-5.5 or gpt-5.5-pro (https://platform.openai.com/docs/models). In any environment that picks this added gpt-5.5 entry, the first OpenAI request will fail with a model-not-found error instead of using a valid latest model ID, so this should be removed or changed to a published alias.

Useful? React with 👍 / 👎.

maxContext: 1050000,
maxTokens: 128000,
quoteMaxToken: 1000000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
reasoning: true,
reasoningEffort: true,
toolChoice: true
},
{
type: ModelTypeEnum.llm,
model: 'gpt-5.5-pro',
maxContext: 1050000,
maxTokens: 128000,
quoteMaxToken: 1000000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
reasoning: true,
reasoningEffort: true,
toolChoice: true,
defaultConfig: {
stream: false
}
},
{
type: ModelTypeEnum.llm,
model: 'gpt-5.4',
maxContext: 250000,
maxContext: 1050000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 1000000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -19,11 +107,10 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5.4-pro',
maxContext: 250000,
maxContext: 1050000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 1000000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
reasoning: true,
reasoningEffort: true,
Expand All @@ -45,9 +132,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5.4-nano',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -58,9 +145,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5.2',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -71,9 +158,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5.1',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -97,9 +184,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -113,9 +200,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5-mini',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand All @@ -129,9 +216,9 @@ const models: ProviderConfigType = {
{
type: ModelTypeEnum.llm,
model: 'gpt-5-nano',
maxContext: 250000,
maxContext: 400000,
maxTokens: 128000,
quoteMaxToken: 200000,
quoteMaxToken: 350000,
maxTemperature: null,
responseFormatList: ['text', 'json_schema'],
vision: true,
Expand Down Expand Up @@ -318,35 +405,28 @@ const models: ProviderConfigType = {
defaultToken: 512,
maxToken: 8000
},
{
type: ModelTypeEnum.tts,
model: 'gpt-4o-mini-tts',
voices: ttsVoices
},
{
type: ModelTypeEnum.tts,
model: 'tts-1',
voices: [
{
label: 'Alloy',
value: 'alloy'
},
{
label: 'Echo',
value: 'echo'
},
{
label: 'Fable',
value: 'fable'
},
{
label: 'Onyx',
value: 'onyx'
},
{
label: 'Nova',
value: 'nova'
},
{
label: 'Shimmer',
value: 'shimmer'
}
]
voices: legacyTtsVoices
},
{
type: ModelTypeEnum.tts,
model: 'tts-1-hd',
voices: legacyTtsVoices
},
{
type: ModelTypeEnum.stt,
model: 'gpt-4o-transcribe'
},
{
type: ModelTypeEnum.stt,
model: 'gpt-4o-mini-transcribe'
},
{
type: ModelTypeEnum.stt,
Expand Down