@ai-sdk/openai 2.0.19 → 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 +6 -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 +1 -1
package/dist/internal/index.js
CHANGED
|
@@ -2998,7 +2998,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
2998
2998
|
controller.enqueue({ type: "stream-start", warnings });
|
|
2999
2999
|
},
|
|
3000
3000
|
transform(chunk, controller) {
|
|
3001
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
3001
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
3002
3002
|
if (options.includeRawChunks) {
|
|
3003
3003
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
3004
3004
|
}
|
|
@@ -3209,12 +3209,12 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3209
3209
|
id: value.item_id,
|
|
3210
3210
|
delta: value.delta
|
|
3211
3211
|
});
|
|
3212
|
-
if (value.logprobs) {
|
|
3212
|
+
if (((_d = (_c = options.providerOptions) == null ? void 0 : _c.openai) == null ? void 0 : _d.logprobs) && value.logprobs) {
|
|
3213
3213
|
logprobs.push(value.logprobs);
|
|
3214
3214
|
}
|
|
3215
3215
|
} else if (isResponseReasoningSummaryPartAddedChunk(value)) {
|
|
3216
3216
|
if (value.summary_index > 0) {
|
|
3217
|
-
(
|
|
3217
|
+
(_e = activeReasoning[value.item_id]) == null ? void 0 : _e.summaryParts.push(
|
|
3218
3218
|
value.summary_index
|
|
3219
3219
|
);
|
|
3220
3220
|
controller.enqueue({
|
|
@@ -3223,7 +3223,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3223
3223
|
providerMetadata: {
|
|
3224
3224
|
openai: {
|
|
3225
3225
|
itemId: value.item_id,
|
|
3226
|
-
reasoningEncryptedContent: (
|
|
3226
|
+
reasoningEncryptedContent: (_g = (_f = activeReasoning[value.item_id]) == null ? void 0 : _f.encryptedContent) != null ? _g : null
|
|
3227
3227
|
}
|
|
3228
3228
|
}
|
|
3229
3229
|
});
|
|
@@ -3241,20 +3241,20 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3241
3241
|
});
|
|
3242
3242
|
} else if (isResponseFinishedChunk(value)) {
|
|
3243
3243
|
finishReason = mapOpenAIResponseFinishReason({
|
|
3244
|
-
finishReason: (
|
|
3244
|
+
finishReason: (_h = value.response.incomplete_details) == null ? void 0 : _h.reason,
|
|
3245
3245
|
hasToolCalls
|
|
3246
3246
|
});
|
|
3247
3247
|
usage.inputTokens = value.response.usage.input_tokens;
|
|
3248
3248
|
usage.outputTokens = value.response.usage.output_tokens;
|
|
3249
3249
|
usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
|
|
3250
|
-
usage.reasoningTokens = (
|
|
3251
|
-
usage.cachedInputTokens = (
|
|
3250
|
+
usage.reasoningTokens = (_j = (_i = value.response.usage.output_tokens_details) == null ? void 0 : _i.reasoning_tokens) != null ? _j : void 0;
|
|
3251
|
+
usage.cachedInputTokens = (_l = (_k = value.response.usage.input_tokens_details) == null ? void 0 : _k.cached_tokens) != null ? _l : void 0;
|
|
3252
3252
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
3253
3253
|
if (value.annotation.type === "url_citation") {
|
|
3254
3254
|
controller.enqueue({
|
|
3255
3255
|
type: "source",
|
|
3256
3256
|
sourceType: "url",
|
|
3257
|
-
id: (
|
|
3257
|
+
id: (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils14.generateId)(),
|
|
3258
3258
|
url: value.annotation.url,
|
|
3259
3259
|
title: value.annotation.title
|
|
3260
3260
|
});
|
|
@@ -3262,7 +3262,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3262
3262
|
controller.enqueue({
|
|
3263
3263
|
type: "source",
|
|
3264
3264
|
sourceType: "document",
|
|
3265
|
-
id: (
|
|
3265
|
+
id: (_r = (_q = (_p = self.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils14.generateId)(),
|
|
3266
3266
|
mediaType: "text/plain",
|
|
3267
3267
|
title: value.annotation.quote,
|
|
3268
3268
|
filename: value.annotation.file_id
|