Merge pull request #704 from RooVetGit/o3_reasoning_effort

Add o3-mini-high and o3-mini-low
This commit is contained in:
Matt Rubens
2025-02-01 00:55:16 -05:00
committed by GitHub
4 changed files with 41 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Add o3-mini-high and o3-mini-low

View File

@@ -300,7 +300,7 @@ describe("OpenAiNativeHandler", () => {
expect(mockCreate).toHaveBeenCalledWith({
model: "o3-mini",
messages: [{ role: "user", content: "Test prompt" }],
temperature: 0,
reasoning_effort: "medium",
})
})

View File

@@ -48,12 +48,15 @@ export class OpenAiNativeHandler implements ApiHandler, SingleCompletionHandler
}
break
}
case "o3-mini": {
case "o3-mini":
case "o3-mini-low":
case "o3-mini-high": {
const stream = await this.client.chat.completions.create({
model: this.getModel().id,
model: "o3-mini",
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
stream: true,
stream_options: { include_usage: true },
reasoning_effort: this.getModel().info.reasoningEffort,
})
for await (const chunk of stream) {
@@ -132,6 +135,16 @@ export class OpenAiNativeHandler implements ApiHandler, SingleCompletionHandler
messages: [{ role: "user", content: prompt }],
}
break
case "o3-mini":
case "o3-mini-low":
case "o3-mini-high":
// o3 doesn't support non-1 temp
requestOptions = {
model: "o3-mini",
messages: [{ role: "user", content: prompt }],
reasoning_effort: this.getModel().info.reasoningEffort,
}
break
default:
requestOptions = {
model: modelId,

View File

@@ -80,6 +80,7 @@ export interface ModelInfo {
cacheWritesPrice?: number
cacheReadsPrice?: number
description?: string
reasoningEffort?: "low" | "medium" | "high"
}
// Anthropic
@@ -517,6 +518,25 @@ export const openAiNativeModels = {
supportsPromptCache: false,
inputPrice: 1.1,
outputPrice: 4.4,
reasoningEffort: "medium",
},
"o3-mini-high": {
maxTokens: 100_000,
contextWindow: 200_000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 1.1,
outputPrice: 4.4,
reasoningEffort: "high",
},
"o3-mini-low": {
maxTokens: 100_000,
contextWindow: 200_000,
supportsImages: false,
supportsPromptCache: false,
inputPrice: 1.1,
outputPrice: 4.4,
reasoningEffort: "low",
},
o1: {
maxTokens: 100_000,