Skip to content

Commit 58fdb6f

Browse files
committed
support o3-mini
1 parent 2bcc7c6 commit 58fdb6f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,20 @@ 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+
})
304+
})
305+
292306
it("should handle API errors", async () => {
293307
mockCreate.mockRejectedValueOnce(new Error("API Error"))
294308
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)