mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Merge pull request #704 from RooVetGit/o3_reasoning_effort
Add o3-mini-high and o3-mini-low
This commit is contained in:
5
.changeset/kind-balloons-grin.md
Normal file
5
.changeset/kind-balloons-grin.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"roo-cline": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add o3-mini-high and o3-mini-low
|
||||||
@@ -300,7 +300,7 @@ describe("OpenAiNativeHandler", () => {
|
|||||||
expect(mockCreate).toHaveBeenCalledWith({
|
expect(mockCreate).toHaveBeenCalledWith({
|
||||||
model: "o3-mini",
|
model: "o3-mini",
|
||||||
messages: [{ role: "user", content: "Test prompt" }],
|
messages: [{ role: "user", content: "Test prompt" }],
|
||||||
temperature: 0,
|
reasoning_effort: "medium",
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,15 @@ export class OpenAiNativeHandler implements ApiHandler, SingleCompletionHandler
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "o3-mini": {
|
case "o3-mini":
|
||||||
|
case "o3-mini-low":
|
||||||
|
case "o3-mini-high": {
|
||||||
const stream = await this.client.chat.completions.create({
|
const stream = await this.client.chat.completions.create({
|
||||||
model: this.getModel().id,
|
model: "o3-mini",
|
||||||
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
|
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
|
||||||
stream: true,
|
stream: true,
|
||||||
stream_options: { include_usage: true },
|
stream_options: { include_usage: true },
|
||||||
|
reasoning_effort: this.getModel().info.reasoningEffort,
|
||||||
})
|
})
|
||||||
|
|
||||||
for await (const chunk of stream) {
|
for await (const chunk of stream) {
|
||||||
@@ -132,6 +135,16 @@ export class OpenAiNativeHandler implements ApiHandler, SingleCompletionHandler
|
|||||||
messages: [{ role: "user", content: prompt }],
|
messages: [{ role: "user", content: prompt }],
|
||||||
}
|
}
|
||||||
break
|
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:
|
default:
|
||||||
requestOptions = {
|
requestOptions = {
|
||||||
model: modelId,
|
model: modelId,
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ export interface ModelInfo {
|
|||||||
cacheWritesPrice?: number
|
cacheWritesPrice?: number
|
||||||
cacheReadsPrice?: number
|
cacheReadsPrice?: number
|
||||||
description?: string
|
description?: string
|
||||||
|
reasoningEffort?: "low" | "medium" | "high"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anthropic
|
// Anthropic
|
||||||
@@ -517,6 +518,25 @@ export const openAiNativeModels = {
|
|||||||
supportsPromptCache: false,
|
supportsPromptCache: false,
|
||||||
inputPrice: 1.1,
|
inputPrice: 1.1,
|
||||||
outputPrice: 4.4,
|
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: {
|
o1: {
|
||||||
maxTokens: 100_000,
|
maxTokens: 100_000,
|
||||||
|
|||||||
Reference in New Issue
Block a user