Skip to content

Commit 5eb8086

Browse files
committed
Add o3-mini support to OpenAI
1 parent 2a078fe commit 5eb8086

File tree

5 files changed

+64
-32
lines changed

5 files changed

+64
-32
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [3.2.11]
4+
5+
- Add OpenAI o3-mini model
6+
37
## [3.2.10]
48

59
- Improve support for DeepSeek-R1 (deepseek-reasoner) model for OpenRouter, OpenAI-compatible, and DeepSeek direct

package-lock.json

Lines changed: 25 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "claude-dev",
33
"displayName": "Cline",
44
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
5-
"version": "3.2.10",
5+
"version": "3.2.11",
66
"icon": "assets/icons/icon.png",
77
"galleryBanner": {
88
"color": "#617A91",
@@ -238,7 +238,7 @@
238238
"isbinaryfile": "^5.0.2",
239239
"mammoth": "^1.8.0",
240240
"monaco-vscode-textmate-theme-converter": "^0.1.7",
241-
"openai": "^4.61.0",
241+
"openai": "^4.82.0",
242242
"os-name": "^6.0.0",
243243
"p-wait-for": "^5.0.2",
244244
"pdf-parse": "^1.1.1",

src/api/providers/openai-native.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ export class OpenAiNativeHandler implements ApiHandler {
4343
}
4444
break
4545
}
46+
case "o3-mini": {
47+
const stream = await this.client.chat.completions.create({
48+
model: this.getModel().id,
49+
messages: [{ role: "developer", content: systemPrompt }, ...convertToOpenAiMessages(messages)],
50+
stream: true,
51+
stream_options: { include_usage: true },
52+
})
53+
for await (const chunk of stream) {
54+
const delta = chunk.choices[0]?.delta
55+
if (delta?.content) {
56+
yield {
57+
type: "text",
58+
text: delta.content,
59+
}
60+
}
61+
if (chunk.usage) {
62+
yield {
63+
type: "usage",
64+
inputTokens: chunk.usage.prompt_tokens || 0,
65+
outputTokens: chunk.usage.completion_tokens || 0,
66+
}
67+
}
68+
}
69+
break
70+
}
4671
default: {
4772
const stream = await this.client.chat.completions.create({
4873
model: this.getModel().id,

src/shared/api.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ export const geminiModels = {
322322
export type OpenAiNativeModelId = keyof typeof openAiNativeModels
323323
export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4o"
324324
export const openAiNativeModels = {
325+
"o3-mini": {
326+
maxTokens: 100_000,
327+
contextWindow: 200_000,
328+
supportsImages: false,
329+
supportsPromptCache: false,
330+
inputPrice: 1.1,
331+
outputPrice: 4.4,
332+
},
325333
// don't support tool use yet
326334
o1: {
327335
maxTokens: 100_000,

0 commit comments

Comments
 (0)