mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-06 02:47:56 +00:00
Add support for different reasoning effort (#2692)
This commit is contained in:
parent
250ea6867a
commit
43668e0429
2 changed files with 35 additions and 3 deletions
|
|
@ -41,7 +41,17 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|||
}
|
||||
|
||||
if (model.id.startsWith("o3-mini")) {
|
||||
yield* this.handleO3FamilyMessage(model, systemPrompt, messages)
|
||||
yield* this.handleReasonerMessage(model, "o3-mini", systemPrompt, messages)
|
||||
return
|
||||
}
|
||||
|
||||
if (model.id.startsWith("o3")) {
|
||||
yield* this.handleReasonerMessage(model, "o3", systemPrompt, messages)
|
||||
return
|
||||
}
|
||||
|
||||
if (model.id.startsWith("o4-mini")) {
|
||||
yield* this.handleReasonerMessage(model, "o4-mini", systemPrompt, messages)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -72,13 +82,14 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|||
yield* this.handleStreamResponse(response, model)
|
||||
}
|
||||
|
||||
private async *handleO3FamilyMessage(
|
||||
private async *handleReasonerMessage(
|
||||
model: OpenAiNativeModel,
|
||||
family: "o3-mini" | "o3" | "o4-mini",
|
||||
systemPrompt: string,
|
||||
messages: Anthropic.Messages.MessageParam[],
|
||||
): ApiStream {
|
||||
const stream = await this.client.chat.completions.create({
|
||||
model: "o3-mini",
|
||||
model: family,
|
||||
messages: [
|
||||
{
|
||||
role: "developer",
|
||||
|
|
|
|||
|
|
@ -786,6 +786,27 @@ export const openAiNativeModels = {
|
|||
inputPrice: 10.0,
|
||||
outputPrice: 40.0,
|
||||
cacheReadsPrice: 2.5,
|
||||
reasoningEffort: "medium",
|
||||
},
|
||||
"o3-high": {
|
||||
maxTokens: 100_000,
|
||||
contextWindow: 200_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 10.0,
|
||||
outputPrice: 40.0,
|
||||
cacheReadsPrice: 2.5,
|
||||
reasoningEffort: "high",
|
||||
},
|
||||
"o3-low": {
|
||||
maxTokens: 100_000,
|
||||
contextWindow: 200_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 10.0,
|
||||
outputPrice: 40.0,
|
||||
cacheReadsPrice: 2.5,
|
||||
reasoningEffort: "low",
|
||||
},
|
||||
"o4-mini": {
|
||||
maxTokens: 100_000,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue