@ai-sdk/openai-compatible 2.0.64 → 2.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/chat/convert-openai-compatible-chat-usage.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/openai-compatible
|
|
2
2
|
|
|
3
|
+
## 2.0.66
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- de18066: fix(provider/openai-compatible): clamp `outputTokens.text` at 0 when a provider reports `completion_tokens_details.reasoning_tokens` greater than `completion_tokens` (observed with Baseten serving reasoning models that hit the length stop mid-reasoning). The text share of completion tokens can never be negative; `total` and `reasoning` remain as reported by the provider.
|
|
8
|
+
- Updated dependencies [2171d15]
|
|
9
|
+
- @ai-sdk/provider@3.0.15
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.44
|
|
11
|
+
|
|
12
|
+
## 2.0.65
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [dab0a08]
|
|
17
|
+
- @ai-sdk/provider-utils@4.0.43
|
|
18
|
+
|
|
3
19
|
## 2.0.64
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ function convertOpenAICompatibleChatUsage(usage) {
|
|
|
96
96
|
},
|
|
97
97
|
outputTokens: {
|
|
98
98
|
total: completionTokens,
|
|
99
|
-
text: completionTokens - reasoningTokens,
|
|
99
|
+
text: Math.max(0, completionTokens - reasoningTokens),
|
|
100
100
|
reasoning: reasoningTokens
|
|
101
101
|
},
|
|
102
102
|
raw: usage
|
|
@@ -1718,7 +1718,7 @@ async function fileToBlob(file) {
|
|
|
1718
1718
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
1719
1719
|
|
|
1720
1720
|
// src/version.ts
|
|
1721
|
-
var VERSION = true ? "2.0.
|
|
1721
|
+
var VERSION = true ? "2.0.66" : "0.0.0-test";
|
|
1722
1722
|
|
|
1723
1723
|
// src/openai-compatible-provider.ts
|
|
1724
1724
|
function createOpenAICompatible(options) {
|