Skip to content

Commit d1f23d2

Browse files
authored
Merge pull request RooCodeInc#686 from shpigunov/origin/feature/support-o3-mini
support o3-mini
2 parents 2bcc7c6 + 7329e94 commit d1f23d2

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/api/providers/__tests__/openai-native.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,21 @@ describe("OpenAiNativeHandler", () => {
289289
})
290290
})
291291

292+
it("should complete prompt successfully with o3-mini model", async () => {
293+
handler = new OpenAiNativeHandler({
294+
apiModelId: "o3-mini",
295+
openAiNativeApiKey: "test-api-key",
296+
})
297+
298+
const result = await handler.completePrompt("Test prompt")
299+
expect(result).toBe("Test response")
300+
expect(mockCreate).toHaveBeenCalledWith({
301+
model: "o3-mini",
302+
messages: [{ role: "user", content: "Test prompt" }],
303+
temperature: 0,
304+
})
305+
})
306+
292307
it("should handle API errors", async () => {
293308
mockCreate.mockRejectedValueOnce(new Error("API Error"))
294309
await expect(handler.completePrompt("Test prompt")).rejects.toThrow(

src/shared/api.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,14 @@ export type OpenAiNativeModelId = keyof typeof openAiNativeModels
510510
export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4o"
511511
export const openAiNativeModels = {
512512
// don't support tool use yet
513+
"o3-mini": {
514+
maxTokens: 100_000,
515+
contextWindow: 200_000,
516+
supportsImages: false,
517+
supportsPromptCache: false,
518+
inputPrice: 1.1,
519+
outputPrice: 4.4,
520+
},
513521
o1: {
514522
maxTokens: 100_000,
515523
contextWindow: 200_000,

0 commit comments

Comments
 (0)