@ai-sdk/openai 2.0.18 → 2.0.20
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 +13 -0
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +9 -9
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +9 -9
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/internal/index.mjs
CHANGED
|
@@ -3018,7 +3018,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3018
3018
|
controller.enqueue({ type: "stream-start", warnings });
|
|
3019
3019
|
},
|
|
3020
3020
|
transform(chunk, controller) {
|
|
3021
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
3021
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
3022
3022
|
if (options.includeRawChunks) {
|
|
3023
3023
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
3024
3024
|
}
|
|
@@ -3229,12 +3229,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3229
3229
|
id: value.item_id,
|
|
3230
3230
|
delta: value.delta
|
|
3231
3231
|
});
|
|
3232
|
-
if (value.logprobs) {
|
|
3232
|
+
if (((_d = (_c = options.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.logprobs) && value.logprobs) {
|
|
3233
3233
|
logprobs.push(value.logprobs);
|
|
3234
3234
|
}
|
|
3235
3235
|
} else if (isResponseReasoningSummaryPartAddedChunk(value)) {
|
|
3236
3236
|
if (value.summary_index > 0) {
|
|
3237
|
-
(
|
|
3237
|
+
(_e = activeReasoning[value.item_id]) == null ? void 0 : _e.summaryParts.push(
|
|
3238
3238
|
value.summary_index
|
|
3239
3239
|
);
|
|
3240
3240
|
controller.enqueue({
|
|
@@ -3243,7 +3243,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3243
3243
|
providerMetadata: {
|
|
3244
3244
|
openai: {
|
|
3245
3245
|
itemId: value.item_id,
|
|
3246
|
-
reasoningEncryptedContent: (
|
|
3246
|
+
reasoningEncryptedContent: (_g = (_f = activeReasoning[value.item_id]) == null ? void 0 : _f.encryptedContent) != null ? _g : null
|
|
3247
3247
|
}
|
|
3248
3248
|
}
|
|
3249
3249
|
});
|
|
@@ -3261,20 +3261,20 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3261
3261
|
});
|
|
3262
3262
|
} else if (isResponseFinishedChunk(value)) {
|
|
3263
3263
|
finishReason = mapOpenAIResponseFinishReason({
|
|
3264
|
-
finishReason: (
|
|
3264
|
+
finishReason: (_h = value.response.incomplete_details) == null ? void 0 : _h.reason,
|
|
3265
3265
|
hasToolCalls
|
|
3266
3266
|
});
|
|
3267
3267
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
3268
3268
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
3269
3269
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
3270
|
-
usage.reasoningTokens = (
|
|
3271
|
-
usage.cachedInputTokens = (
|
|
3270
|
+
usage.reasoningTokens = (_j = (_i = value.response.usage.output_tokens_details) == null ? void 0 : _i.reasoning_tokens) != null ? _j : void 0;
|
|
3271
|
+
usage.cachedInputTokens = (_l = (_k = value.response.usage.input_tokens_details) == null ? void 0 : _k.cached_tokens) != null ? _l : void 0;
|
|
3272
3272
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
3273
3273
|
if (value.annotation.type === "url_citation") {
|
|
3274
3274
|
controller.enqueue({
|
|
3275
3275
|
type: "source",
|
|
3276
3276
|
sourceType: "url",
|
|
3277
|
-
id: (
|
|
3277
|
+
id: (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
|
|
3278
3278
|
url: value.annotation.url,
|
|
3279
3279
|
title: value.annotation.title
|
|
3280
3280
|
});
|
|
@@ -3282,7 +3282,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3282
3282
|
controller.enqueue({
|
|
3283
3283
|
type: "source",
|
|
3284
3284
|
sourceType: "document",
|
|
3285
|
-
id: (
|
|
3285
|
+
id: (_r = (_q = (_p = self.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
|
|
3286
3286
|
mediaType: "text/plain",
|
|
3287
3287
|
title: value.annotation.quote,
|
|
3288
3288
|
filename: value.annotation.file_id
|