@ai-sdk/openai
Advanced tools
Comparing version 1.0.16 to 1.0.17
# @ai-sdk/openai | ||
## 1.0.17 | ||
### Patch Changes | ||
- ba62cf2: feat (provider/openai): automatically map maxTokens to max_completion_tokens for reasoning models | ||
- 3c3fae8: fix (provider/openai): add o1-mini-2024-09-12 and o1-preview-2024-09-12 configurations | ||
## 1.0.16 | ||
@@ -4,0 +11,0 @@ |
@@ -458,2 +458,3 @@ "use strict"; | ||
// openai specific settings: | ||
// TODO remove in next major version; we auto-map maxTokens now | ||
max_completion_tokens: (_b = providerMetadata == null ? void 0 : providerMetadata.openai) == null ? void 0 : _b.maxCompletionTokens, | ||
@@ -525,2 +526,8 @@ store: (_c = providerMetadata == null ? void 0 : providerMetadata.openai) == null ? void 0 : _c.store, | ||
} | ||
if (baseArgs.max_tokens != null) { | ||
if (baseArgs.max_completion_tokens == null) { | ||
baseArgs.max_completion_tokens = baseArgs.max_tokens; | ||
} | ||
baseArgs.max_tokens = void 0; | ||
} | ||
} | ||
@@ -1048,5 +1055,13 @@ switch (type) { | ||
}, | ||
"o1-mini-2024-09-12": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
}, | ||
"o1-preview": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
}, | ||
"o1-preview-2024-09-12": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
} | ||
@@ -1053,0 +1068,0 @@ }; |
@@ -456,2 +456,3 @@ "use strict"; | ||
// openai specific settings: | ||
// TODO remove in next major version; we auto-map maxTokens now | ||
max_completion_tokens: (_b = providerMetadata == null ? void 0 : providerMetadata.openai) == null ? void 0 : _b.maxCompletionTokens, | ||
@@ -523,2 +524,8 @@ store: (_c = providerMetadata == null ? void 0 : providerMetadata.openai) == null ? void 0 : _c.store, | ||
} | ||
if (baseArgs.max_tokens != null) { | ||
if (baseArgs.max_completion_tokens == null) { | ||
baseArgs.max_completion_tokens = baseArgs.max_tokens; | ||
} | ||
baseArgs.max_tokens = void 0; | ||
} | ||
} | ||
@@ -1046,5 +1053,13 @@ switch (type) { | ||
}, | ||
"o1-mini-2024-09-12": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
}, | ||
"o1-preview": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
}, | ||
"o1-preview-2024-09-12": { | ||
systemMessageMode: "remove", | ||
simulateStreamingByDefault: false | ||
} | ||
@@ -1051,0 +1066,0 @@ }; |
{ | ||
"name": "@ai-sdk/openai", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
660627
6682