mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-19 20:01:08 -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({
|
||||
model: "o3-mini",
|
||||
messages: [{ role: "user", content: "Test prompt" }],
|
||||
temperature: 0,
|
||||
reasoning_effort: "medium",
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user