mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: add GPT-5 models with updated context windows
- Added gpt-5-2025-08-07, gpt-5-mini-2025-08-07, gpt-5-nano-2025-08-07 models - All GPT-5 models configured with 400,000 context window - Updated nectarine model context window to 256,000 - All models configured with reasoning effort support - Set gpt-5-2025-08-07 as default OpenAI Native model - Added GPT-5 model handling in openai-native.ts - Updated tests to reflect new default model
This commit is contained in:
parent
0c3260205d
commit
7c5e5a0957
3 changed files with 38 additions and 4 deletions
|
|
@ -3,10 +3,10 @@ import type { ModelInfo } from "../model.js"
|
|||
// https://openai.com/api/pricing/
|
||||
export type OpenAiNativeModelId = keyof typeof openAiNativeModels
|
||||
|
||||
export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4o"
|
||||
export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5-2025-08-07"
|
||||
|
||||
export const openAiNativeModels = {
|
||||
"nectarine-alpha-new-reasoning-effort-2025-07-25": {
|
||||
"gpt-5-2025-08-07": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 400000,
|
||||
supportsImages: true,
|
||||
|
|
@ -16,6 +16,36 @@ export const openAiNativeModels = {
|
|||
outputPrice: 0,
|
||||
cacheReadsPrice: 0,
|
||||
},
|
||||
"gpt-5-mini-2025-08-07": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 400000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: true,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
cacheReadsPrice: 0,
|
||||
},
|
||||
"gpt-5-nano-2025-08-07": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 400000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: true,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
cacheReadsPrice: 0,
|
||||
},
|
||||
"nectarine-alpha-new-reasoning-effort-2025-07-25": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 256000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: true,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
cacheReadsPrice: 0,
|
||||
},
|
||||
"gpt-4.1": {
|
||||
maxTokens: 32_768,
|
||||
contextWindow: 1_047_576,
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ describe("OpenAiNativeHandler", () => {
|
|||
openAiNativeApiKey: "test-api-key",
|
||||
})
|
||||
const modelInfo = handlerWithoutModel.getModel()
|
||||
expect(modelInfo.id).toBe("gpt-4o") // Default model
|
||||
expect(modelInfo.id).toBe("gpt-5-2025-08-07") // Default model
|
||||
expect(modelInfo.info).toBeDefined()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|||
yield* this.handleReasonerMessage(model, id, systemPrompt, messages)
|
||||
} else if (model.id.startsWith("o1")) {
|
||||
yield* this.handleO1FamilyMessage(model, systemPrompt, messages)
|
||||
} else if (this.isNectarineModel(model.id)) {
|
||||
} else if (this.isNectarineModel(model.id) || this.isGpt5Model(model.id)) {
|
||||
yield* this.handleNectarineMessage(model, systemPrompt, messages)
|
||||
} else {
|
||||
yield* this.handleDefaultModelMessage(model, systemPrompt, messages)
|
||||
|
|
@ -154,6 +154,10 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|||
return modelId.includes("nectarine")
|
||||
}
|
||||
|
||||
private isGpt5Model(modelId: string): boolean {
|
||||
return modelId.startsWith("gpt-5")
|
||||
}
|
||||
|
||||
private async *handleStreamResponse(
|
||||
stream: AsyncIterable<OpenAI.Chat.Completions.ChatCompletionChunk>,
|
||||
model: OpenAiNativeModel,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue