@ai-sdk/openai 3.0.106 → 3.0.107
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 +7 -0
- package/dist/index.d.mts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +80 -67
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -67
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +17 -15
- package/dist/internal/index.d.ts +17 -15
- package/dist/internal/index.js +79 -66
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +79 -66
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/openai-stream-error.ts +58 -3
- package/src/responses/convert-openai-responses-usage.ts +17 -12
- package/src/responses/openai-responses-api.ts +34 -58
- package/src/responses/openai-responses-language-model.ts +19 -12
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -250,23 +250,24 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
250
250
|
} | {
|
|
251
251
|
type: "response.completed" | "response.incomplete";
|
|
252
252
|
response: {
|
|
253
|
-
|
|
253
|
+
incomplete_details?: {
|
|
254
|
+
reason: string;
|
|
255
|
+
} | null | undefined;
|
|
256
|
+
usage?: (Record<string, JSONValue | undefined> & {
|
|
254
257
|
input_tokens: number;
|
|
255
258
|
output_tokens: number;
|
|
256
|
-
input_tokens_details?: {
|
|
259
|
+
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
257
260
|
cached_tokens?: number | null | undefined;
|
|
258
261
|
cache_write_tokens?: number | null | undefined;
|
|
259
262
|
orchestration_input_tokens?: number | null | undefined;
|
|
260
263
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
261
|
-
} | null | undefined;
|
|
262
|
-
output_tokens_details?: {
|
|
264
|
+
}) | null | undefined;
|
|
265
|
+
output_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
263
266
|
reasoning_tokens?: number | null | undefined;
|
|
264
267
|
orchestration_output_tokens?: number | null | undefined;
|
|
265
|
-
} | null | undefined;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
reason: string;
|
|
269
|
-
} | null | undefined;
|
|
268
|
+
}) | null | undefined;
|
|
269
|
+
total_tokens?: number | undefined;
|
|
270
|
+
}) | null | undefined;
|
|
270
271
|
reasoning?: {
|
|
271
272
|
context?: string | null | undefined;
|
|
272
273
|
} | null | undefined;
|
|
@@ -283,20 +284,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
283
284
|
incomplete_details?: {
|
|
284
285
|
reason: string;
|
|
285
286
|
} | null | undefined;
|
|
286
|
-
usage?: {
|
|
287
|
+
usage?: (Record<string, JSONValue | undefined> & {
|
|
287
288
|
input_tokens: number;
|
|
288
289
|
output_tokens: number;
|
|
289
|
-
input_tokens_details?: {
|
|
290
|
+
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
290
291
|
cached_tokens?: number | null | undefined;
|
|
291
292
|
cache_write_tokens?: number | null | undefined;
|
|
292
293
|
orchestration_input_tokens?: number | null | undefined;
|
|
293
294
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
294
|
-
} | null | undefined;
|
|
295
|
-
output_tokens_details?: {
|
|
295
|
+
}) | null | undefined;
|
|
296
|
+
output_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
296
297
|
reasoning_tokens?: number | null | undefined;
|
|
297
298
|
orchestration_output_tokens?: number | null | undefined;
|
|
298
|
-
} | null | undefined;
|
|
299
|
-
|
|
299
|
+
}) | null | undefined;
|
|
300
|
+
total_tokens?: number | undefined;
|
|
301
|
+
}) | null | undefined;
|
|
300
302
|
reasoning?: {
|
|
301
303
|
context?: string | null | undefined;
|
|
302
304
|
} | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -250,23 +250,24 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
250
250
|
} | {
|
|
251
251
|
type: "response.completed" | "response.incomplete";
|
|
252
252
|
response: {
|
|
253
|
-
|
|
253
|
+
incomplete_details?: {
|
|
254
|
+
reason: string;
|
|
255
|
+
} | null | undefined;
|
|
256
|
+
usage?: (Record<string, JSONValue | undefined> & {
|
|
254
257
|
input_tokens: number;
|
|
255
258
|
output_tokens: number;
|
|
256
|
-
input_tokens_details?: {
|
|
259
|
+
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
257
260
|
cached_tokens?: number | null | undefined;
|
|
258
261
|
cache_write_tokens?: number | null | undefined;
|
|
259
262
|
orchestration_input_tokens?: number | null | undefined;
|
|
260
263
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
261
|
-
} | null | undefined;
|
|
262
|
-
output_tokens_details?: {
|
|
264
|
+
}) | null | undefined;
|
|
265
|
+
output_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
263
266
|
reasoning_tokens?: number | null | undefined;
|
|
264
267
|
orchestration_output_tokens?: number | null | undefined;
|
|
265
|
-
} | null | undefined;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
reason: string;
|
|
269
|
-
} | null | undefined;
|
|
268
|
+
}) | null | undefined;
|
|
269
|
+
total_tokens?: number | undefined;
|
|
270
|
+
}) | null | undefined;
|
|
270
271
|
reasoning?: {
|
|
271
272
|
context?: string | null | undefined;
|
|
272
273
|
} | null | undefined;
|
|
@@ -283,20 +284,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
283
284
|
incomplete_details?: {
|
|
284
285
|
reason: string;
|
|
285
286
|
} | null | undefined;
|
|
286
|
-
usage?: {
|
|
287
|
+
usage?: (Record<string, JSONValue | undefined> & {
|
|
287
288
|
input_tokens: number;
|
|
288
289
|
output_tokens: number;
|
|
289
|
-
input_tokens_details?: {
|
|
290
|
+
input_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
290
291
|
cached_tokens?: number | null | undefined;
|
|
291
292
|
cache_write_tokens?: number | null | undefined;
|
|
292
293
|
orchestration_input_tokens?: number | null | undefined;
|
|
293
294
|
orchestration_input_cached_tokens?: number | null | undefined;
|
|
294
|
-
} | null | undefined;
|
|
295
|
-
output_tokens_details?: {
|
|
295
|
+
}) | null | undefined;
|
|
296
|
+
output_tokens_details?: (Record<string, JSONValue | undefined> & {
|
|
296
297
|
reasoning_tokens?: number | null | undefined;
|
|
297
298
|
orchestration_output_tokens?: number | null | undefined;
|
|
298
|
-
} | null | undefined;
|
|
299
|
-
|
|
299
|
+
}) | null | undefined;
|
|
300
|
+
total_tokens?: number | undefined;
|
|
301
|
+
}) | null | undefined;
|
|
300
302
|
reasoning?: {
|
|
301
303
|
context?: string | null | undefined;
|
|
302
304
|
} | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -90,6 +90,22 @@ function getGptVersion(modelId) {
|
|
|
90
90
|
|
|
91
91
|
// src/openai-stream-error.ts
|
|
92
92
|
var import_provider = require("@ai-sdk/provider");
|
|
93
|
+
function createOpenAIProviderStreamError(frame) {
|
|
94
|
+
var _a2, _b;
|
|
95
|
+
const streamError = parseStreamError(frame);
|
|
96
|
+
if (streamError == null) {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
const statusCode = getStatusCode(streamError);
|
|
100
|
+
return {
|
|
101
|
+
message: streamError.message,
|
|
102
|
+
type: (_a2 = streamError.type) != null ? _a2 : void 0,
|
|
103
|
+
code: (_b = streamError.code) != null ? _b : void 0,
|
|
104
|
+
statusCode,
|
|
105
|
+
isRetryable: isRetryableStreamError(streamError, statusCode),
|
|
106
|
+
data: frame
|
|
107
|
+
};
|
|
108
|
+
}
|
|
93
109
|
async function throwIfOpenAIStreamErrorBeforeOutput({
|
|
94
110
|
stream,
|
|
95
111
|
getError,
|
|
@@ -161,16 +177,14 @@ function parseStreamError(frame) {
|
|
|
161
177
|
return typeof (responseError == null ? void 0 : responseError.message) === "string" ? {
|
|
162
178
|
message: responseError.message,
|
|
163
179
|
code: getStringOrNumber(responseError.code),
|
|
164
|
-
type: "response.failed"
|
|
165
|
-
frame
|
|
180
|
+
type: "response.failed"
|
|
166
181
|
} : void 0;
|
|
167
182
|
}
|
|
168
183
|
const error = (_a2 = asRecord(value.error)) != null ? _a2 : value;
|
|
169
184
|
return typeof error.message === "string" && (asRecord(value.error) != null || typeof error.type === "string" || "code" in error || "param" in error) ? {
|
|
170
185
|
message: error.message,
|
|
171
186
|
code: getStringOrNumber(error.code),
|
|
172
|
-
type: typeof error.type === "string" ? error.type : void 0
|
|
173
|
-
frame
|
|
187
|
+
type: typeof error.type === "string" ? error.type : void 0
|
|
174
188
|
} : void 0;
|
|
175
189
|
}
|
|
176
190
|
function getStatusCode(error) {
|
|
@@ -210,6 +224,15 @@ function getStringOrNumber(value) {
|
|
|
210
224
|
function isHttpErrorStatusCode(value) {
|
|
211
225
|
return Number.isInteger(value) && value >= 400 && value <= 599;
|
|
212
226
|
}
|
|
227
|
+
function isRetryableStatusCode(statusCode) {
|
|
228
|
+
return statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500;
|
|
229
|
+
}
|
|
230
|
+
function isRetryableStreamError(error, statusCode) {
|
|
231
|
+
if (error.code === "insufficient_quota" || error.type === "insufficient_quota") {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
return isRetryableStatusCode(statusCode);
|
|
235
|
+
}
|
|
213
236
|
|
|
214
237
|
// src/chat/convert-openai-chat-usage.ts
|
|
215
238
|
function convertOpenAIChatUsage(usage) {
|
|
@@ -4008,6 +4031,31 @@ var jsonValueSchema2 = import_v422.z.lazy(
|
|
|
4008
4031
|
import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional())
|
|
4009
4032
|
])
|
|
4010
4033
|
);
|
|
4034
|
+
var jsonObjectSchema = import_v422.z.record(import_v422.z.string(), jsonValueSchema2.optional());
|
|
4035
|
+
var openaiResponsesUsageSchema = import_v422.z.intersection(
|
|
4036
|
+
jsonObjectSchema,
|
|
4037
|
+
import_v422.z.object({
|
|
4038
|
+
input_tokens: import_v422.z.number(),
|
|
4039
|
+
input_tokens_details: import_v422.z.intersection(
|
|
4040
|
+
jsonObjectSchema,
|
|
4041
|
+
import_v422.z.object({
|
|
4042
|
+
cached_tokens: import_v422.z.number().nullish(),
|
|
4043
|
+
cache_write_tokens: import_v422.z.number().nullish(),
|
|
4044
|
+
orchestration_input_tokens: import_v422.z.number().nullish(),
|
|
4045
|
+
orchestration_input_cached_tokens: import_v422.z.number().nullish()
|
|
4046
|
+
})
|
|
4047
|
+
).nullish(),
|
|
4048
|
+
output_tokens: import_v422.z.number(),
|
|
4049
|
+
output_tokens_details: import_v422.z.intersection(
|
|
4050
|
+
jsonObjectSchema,
|
|
4051
|
+
import_v422.z.object({
|
|
4052
|
+
reasoning_tokens: import_v422.z.number().nullish(),
|
|
4053
|
+
orchestration_output_tokens: import_v422.z.number().nullish()
|
|
4054
|
+
})
|
|
4055
|
+
).nullish(),
|
|
4056
|
+
total_tokens: import_v422.z.number().optional()
|
|
4057
|
+
})
|
|
4058
|
+
);
|
|
4011
4059
|
function isRecord(value) {
|
|
4012
4060
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4013
4061
|
}
|
|
@@ -4119,20 +4167,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4119
4167
|
type: import_v422.z.enum(["response.completed", "response.incomplete"]),
|
|
4120
4168
|
response: import_v422.z.object({
|
|
4121
4169
|
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
4122
|
-
usage:
|
|
4123
|
-
input_tokens: import_v422.z.number(),
|
|
4124
|
-
input_tokens_details: import_v422.z.object({
|
|
4125
|
-
cached_tokens: import_v422.z.number().nullish(),
|
|
4126
|
-
cache_write_tokens: import_v422.z.number().nullish(),
|
|
4127
|
-
orchestration_input_tokens: import_v422.z.number().nullish(),
|
|
4128
|
-
orchestration_input_cached_tokens: import_v422.z.number().nullish()
|
|
4129
|
-
}).nullish(),
|
|
4130
|
-
output_tokens: import_v422.z.number(),
|
|
4131
|
-
output_tokens_details: import_v422.z.object({
|
|
4132
|
-
reasoning_tokens: import_v422.z.number().nullish(),
|
|
4133
|
-
orchestration_output_tokens: import_v422.z.number().nullish()
|
|
4134
|
-
}).nullish()
|
|
4135
|
-
}),
|
|
4170
|
+
usage: openaiResponsesUsageSchema.nullish(),
|
|
4136
4171
|
reasoning: import_v422.z.object({
|
|
4137
4172
|
context: import_v422.z.string().nullish()
|
|
4138
4173
|
}).nullish(),
|
|
@@ -4148,20 +4183,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4148
4183
|
message: import_v422.z.string()
|
|
4149
4184
|
}).nullish(),
|
|
4150
4185
|
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
4151
|
-
usage:
|
|
4152
|
-
input_tokens: import_v422.z.number(),
|
|
4153
|
-
input_tokens_details: import_v422.z.object({
|
|
4154
|
-
cached_tokens: import_v422.z.number().nullish(),
|
|
4155
|
-
cache_write_tokens: import_v422.z.number().nullish(),
|
|
4156
|
-
orchestration_input_tokens: import_v422.z.number().nullish(),
|
|
4157
|
-
orchestration_input_cached_tokens: import_v422.z.number().nullish()
|
|
4158
|
-
}).nullish(),
|
|
4159
|
-
output_tokens: import_v422.z.number(),
|
|
4160
|
-
output_tokens_details: import_v422.z.object({
|
|
4161
|
-
reasoning_tokens: import_v422.z.number().nullish(),
|
|
4162
|
-
orchestration_output_tokens: import_v422.z.number().nullish()
|
|
4163
|
-
}).nullish()
|
|
4164
|
-
}).nullish(),
|
|
4186
|
+
usage: openaiResponsesUsageSchema.nullish(),
|
|
4165
4187
|
reasoning: import_v422.z.object({
|
|
4166
4188
|
context: import_v422.z.string().nullish()
|
|
4167
4189
|
}).nullish(),
|
|
@@ -4927,20 +4949,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils28.lazySchema)(
|
|
|
4927
4949
|
context: import_v422.z.string().nullish()
|
|
4928
4950
|
}).nullish(),
|
|
4929
4951
|
incomplete_details: import_v422.z.object({ reason: import_v422.z.string() }).nullish(),
|
|
4930
|
-
usage:
|
|
4931
|
-
input_tokens: import_v422.z.number(),
|
|
4932
|
-
input_tokens_details: import_v422.z.object({
|
|
4933
|
-
cached_tokens: import_v422.z.number().nullish(),
|
|
4934
|
-
cache_write_tokens: import_v422.z.number().nullish(),
|
|
4935
|
-
orchestration_input_tokens: import_v422.z.number().nullish(),
|
|
4936
|
-
orchestration_input_cached_tokens: import_v422.z.number().nullish()
|
|
4937
|
-
}).nullish(),
|
|
4938
|
-
output_tokens: import_v422.z.number(),
|
|
4939
|
-
output_tokens_details: import_v422.z.object({
|
|
4940
|
-
reasoning_tokens: import_v422.z.number().nullish(),
|
|
4941
|
-
orchestration_output_tokens: import_v422.z.number().nullish()
|
|
4942
|
-
}).nullish()
|
|
4943
|
-
}).optional()
|
|
4952
|
+
usage: openaiResponsesUsageSchema.nullish()
|
|
4944
4953
|
})
|
|
4945
4954
|
)
|
|
4946
4955
|
);
|
|
@@ -6527,7 +6536,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6527
6536
|
controller.enqueue({ type: "stream-start", warnings });
|
|
6528
6537
|
},
|
|
6529
6538
|
transform(chunk, controller) {
|
|
6530
|
-
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
|
|
6539
|
+
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S;
|
|
6531
6540
|
if (options.includeRawChunks) {
|
|
6532
6541
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
6533
6542
|
}
|
|
@@ -7348,15 +7357,15 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7348
7357
|
raw: (_z = (_y = value.response.incomplete_details) == null ? void 0 : _y.reason) != null ? _z : void 0
|
|
7349
7358
|
};
|
|
7350
7359
|
}
|
|
7351
|
-
usage = value.response.usage;
|
|
7360
|
+
usage = (_A = value.response.usage) != null ? _A : void 0;
|
|
7352
7361
|
if (typeof value.response.service_tier === "string") {
|
|
7353
7362
|
serviceTier = value.response.service_tier;
|
|
7354
7363
|
}
|
|
7355
|
-
if (((
|
|
7364
|
+
if (((_B = value.response.reasoning) == null ? void 0 : _B.context) != null) {
|
|
7356
7365
|
reasoningContext = value.response.reasoning.context;
|
|
7357
7366
|
}
|
|
7358
7367
|
} else if (isResponseFailedChunk(value)) {
|
|
7359
|
-
const incompleteReason = (
|
|
7368
|
+
const incompleteReason = (_C = value.response.incomplete_details) == null ? void 0 : _C.reason;
|
|
7360
7369
|
finishReason = {
|
|
7361
7370
|
unified: incompleteReason ? mapOpenAIResponseFinishReason({
|
|
7362
7371
|
finishReason: incompleteReason,
|
|
@@ -7364,23 +7373,24 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7364
7373
|
}) : "error",
|
|
7365
7374
|
raw: incompleteReason != null ? incompleteReason : "error"
|
|
7366
7375
|
};
|
|
7367
|
-
usage = (
|
|
7368
|
-
if (((
|
|
7376
|
+
usage = (_D = value.response.usage) != null ? _D : void 0;
|
|
7377
|
+
if (((_E = value.response.reasoning) == null ? void 0 : _E.context) != null) {
|
|
7369
7378
|
reasoningContext = value.response.reasoning.context;
|
|
7370
7379
|
}
|
|
7371
7380
|
if (!encounteredStreamError && value.response.error != null) {
|
|
7372
7381
|
encounteredStreamError = true;
|
|
7382
|
+
const error = {
|
|
7383
|
+
type: "response.failed",
|
|
7384
|
+
sequence_number: value.sequence_number,
|
|
7385
|
+
response: {
|
|
7386
|
+
error: value.response.error,
|
|
7387
|
+
incomplete_details: value.response.incomplete_details,
|
|
7388
|
+
service_tier: value.response.service_tier
|
|
7389
|
+
}
|
|
7390
|
+
};
|
|
7373
7391
|
controller.enqueue({
|
|
7374
7392
|
type: "error",
|
|
7375
|
-
error:
|
|
7376
|
-
type: "response.failed",
|
|
7377
|
-
sequence_number: value.sequence_number,
|
|
7378
|
-
response: {
|
|
7379
|
-
error: value.response.error,
|
|
7380
|
-
incomplete_details: value.response.incomplete_details,
|
|
7381
|
-
service_tier: value.response.service_tier
|
|
7382
|
-
}
|
|
7383
|
-
}
|
|
7393
|
+
error: (_F = createOpenAIProviderStreamError(error)) != null ? _F : error
|
|
7384
7394
|
});
|
|
7385
7395
|
}
|
|
7386
7396
|
} else if (isResponseAnnotationAddedChunk(value)) {
|
|
@@ -7389,7 +7399,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7389
7399
|
controller.enqueue({
|
|
7390
7400
|
type: "source",
|
|
7391
7401
|
sourceType: "url",
|
|
7392
|
-
id: (
|
|
7402
|
+
id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils31.generateId)(),
|
|
7393
7403
|
url: value.annotation.url,
|
|
7394
7404
|
title: value.annotation.title
|
|
7395
7405
|
});
|
|
@@ -7397,7 +7407,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7397
7407
|
controller.enqueue({
|
|
7398
7408
|
type: "source",
|
|
7399
7409
|
sourceType: "document",
|
|
7400
|
-
id: (
|
|
7410
|
+
id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils31.generateId)(),
|
|
7401
7411
|
mediaType: "text/plain",
|
|
7402
7412
|
title: value.annotation.filename,
|
|
7403
7413
|
filename: value.annotation.filename,
|
|
@@ -7413,7 +7423,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7413
7423
|
controller.enqueue({
|
|
7414
7424
|
type: "source",
|
|
7415
7425
|
sourceType: "document",
|
|
7416
|
-
id: (
|
|
7426
|
+
id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : (0, import_provider_utils31.generateId)(),
|
|
7417
7427
|
mediaType: "text/plain",
|
|
7418
7428
|
title: value.annotation.filename,
|
|
7419
7429
|
filename: value.annotation.filename,
|
|
@@ -7429,7 +7439,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7429
7439
|
controller.enqueue({
|
|
7430
7440
|
type: "source",
|
|
7431
7441
|
sourceType: "document",
|
|
7432
|
-
id: (
|
|
7442
|
+
id: (_R = (_Q = (_P = self.config).generateId) == null ? void 0 : _Q.call(_P)) != null ? _R : (0, import_provider_utils31.generateId)(),
|
|
7433
7443
|
mediaType: "application/octet-stream",
|
|
7434
7444
|
title: value.annotation.file_id,
|
|
7435
7445
|
filename: value.annotation.file_id,
|
|
@@ -7445,7 +7455,10 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
7445
7455
|
} else if (isErrorChunk(value)) {
|
|
7446
7456
|
encounteredStreamError = true;
|
|
7447
7457
|
finishReason = { unified: "error", raw: "error" };
|
|
7448
|
-
controller.enqueue({
|
|
7458
|
+
controller.enqueue({
|
|
7459
|
+
type: "error",
|
|
7460
|
+
error: (_S = createOpenAIProviderStreamError(value)) != null ? _S : value
|
|
7461
|
+
});
|
|
7449
7462
|
}
|
|
7450
7463
|
},
|
|
7451
7464
|
flush(controller) {
|
|
@@ -7948,7 +7961,7 @@ var OpenAITranscriptionModel = class {
|
|
|
7948
7961
|
};
|
|
7949
7962
|
|
|
7950
7963
|
// src/version.ts
|
|
7951
|
-
var VERSION = true ? "3.0.
|
|
7964
|
+
var VERSION = true ? "3.0.107" : "0.0.0-test";
|
|
7952
7965
|
|
|
7953
7966
|
// src/openai-provider.ts
|
|
7954
7967
|
function createOpenAI(options = {}) {
|