@ai-sdk/open-responses 2.0.0-beta.9 → 2.0.0-canary.35
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 +230 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +177 -109
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
- package/src/index.ts +9 -0
- package/src/open-responses-provider.ts +4 -4
- package/src/responses/convert-to-open-responses-input.ts +79 -41
- package/src/responses/map-open-responses-finish-reason.ts +1 -1
- package/src/responses/open-responses-api.ts +2 -3
- package/src/responses/open-responses-config.ts +3 -2
- package/src/responses/open-responses-language-model-options.ts +22 -0
- package/src/responses/open-responses-language-model.ts +45 -12
- package/dist/index.d.mts +0 -34
- package/dist/index.mjs +0 -628
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
VERSION: () => VERSION,
|
|
24
|
-
createOpenResponses: () => createOpenResponses
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
|
|
28
1
|
// src/version.ts
|
|
29
|
-
var VERSION = true ? "2.0.0-
|
|
2
|
+
var VERSION = true ? "2.0.0-canary.35" : "0.0.0-test";
|
|
30
3
|
|
|
31
4
|
// src/open-responses-provider.ts
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
import {
|
|
6
|
+
NoSuchModelError
|
|
7
|
+
} from "@ai-sdk/provider";
|
|
8
|
+
import {
|
|
9
|
+
generateId,
|
|
10
|
+
withUserAgentSuffix
|
|
11
|
+
} from "@ai-sdk/provider-utils";
|
|
34
12
|
|
|
35
13
|
// src/responses/open-responses-language-model.ts
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
import {
|
|
15
|
+
combineHeaders,
|
|
16
|
+
createEventSourceResponseHandler,
|
|
17
|
+
createJsonErrorResponseHandler,
|
|
18
|
+
createJsonResponseHandler,
|
|
19
|
+
isCustomReasoning,
|
|
20
|
+
jsonSchema,
|
|
21
|
+
mapReasoningToProviderEffort,
|
|
22
|
+
parseProviderOptions,
|
|
23
|
+
postJsonToApi,
|
|
24
|
+
serializeModelOptions,
|
|
25
|
+
WORKFLOW_SERIALIZE,
|
|
26
|
+
WORKFLOW_DESERIALIZE
|
|
27
|
+
} from "@ai-sdk/provider-utils";
|
|
28
|
+
import { z as z3 } from "zod/v4";
|
|
38
29
|
|
|
39
30
|
// src/responses/convert-to-open-responses-input.ts
|
|
40
|
-
|
|
31
|
+
import {
|
|
32
|
+
UnsupportedFunctionalityError
|
|
33
|
+
} from "@ai-sdk/provider";
|
|
34
|
+
import {
|
|
35
|
+
convertToBase64,
|
|
36
|
+
getTopLevelMediaType,
|
|
37
|
+
resolveFullMediaType
|
|
38
|
+
} from "@ai-sdk/provider-utils";
|
|
41
39
|
async function convertToOpenResponsesInput({
|
|
42
40
|
prompt
|
|
43
41
|
}) {
|
|
@@ -60,20 +58,35 @@ async function convertToOpenResponsesInput({
|
|
|
60
58
|
break;
|
|
61
59
|
}
|
|
62
60
|
case "file": {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
71
|
-
userContent.push({
|
|
72
|
-
type: "input_image",
|
|
73
|
-
...part.data instanceof URL ? { image_url: part.data.toString() } : {
|
|
74
|
-
image_url: `data:${mediaType};base64,${(0, import_provider_utils.convertToBase64)(part.data)}`
|
|
61
|
+
switch (part.data.type) {
|
|
62
|
+
case "reference": {
|
|
63
|
+
throw new UnsupportedFunctionalityError({
|
|
64
|
+
functionality: "file parts with provider references"
|
|
65
|
+
});
|
|
75
66
|
}
|
|
76
|
-
|
|
67
|
+
case "text": {
|
|
68
|
+
throw new UnsupportedFunctionalityError({
|
|
69
|
+
functionality: "text file parts"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
case "url":
|
|
73
|
+
case "data": {
|
|
74
|
+
if (getTopLevelMediaType(part.mediaType) !== "image") {
|
|
75
|
+
warnings.push({
|
|
76
|
+
type: "other",
|
|
77
|
+
message: `unsupported file content type: ${part.mediaType}`
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
userContent.push({
|
|
82
|
+
type: "input_image",
|
|
83
|
+
...part.data.type === "url" ? { image_url: part.data.url.toString() } : {
|
|
84
|
+
image_url: `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}`
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
77
90
|
break;
|
|
78
91
|
}
|
|
79
92
|
}
|
|
@@ -125,7 +138,7 @@ async function convertToOpenResponsesInput({
|
|
|
125
138
|
contentValue = output.value;
|
|
126
139
|
break;
|
|
127
140
|
case "execution-denied":
|
|
128
|
-
contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
|
|
141
|
+
contentValue = (_a = output.reason) != null ? _a : "Tool call execution denied.";
|
|
129
142
|
break;
|
|
130
143
|
case "json":
|
|
131
144
|
case "error-json":
|
|
@@ -142,26 +155,42 @@ async function convertToOpenResponsesInput({
|
|
|
142
155
|
});
|
|
143
156
|
break;
|
|
144
157
|
}
|
|
145
|
-
case "
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
case "file": {
|
|
159
|
+
const topLevel = getTopLevelMediaType(item.mediaType);
|
|
160
|
+
if (item.data.type === "data") {
|
|
161
|
+
const fullMediaType = resolveFullMediaType({
|
|
162
|
+
part: item
|
|
163
|
+
});
|
|
164
|
+
if (topLevel === "image") {
|
|
165
|
+
contentParts.push({
|
|
166
|
+
type: "input_image",
|
|
167
|
+
image_url: `data:${fullMediaType};base64,${convertToBase64(item.data.data)}`
|
|
168
|
+
});
|
|
169
|
+
} else {
|
|
170
|
+
contentParts.push({
|
|
171
|
+
type: "input_file",
|
|
172
|
+
filename: (_b = item.filename) != null ? _b : "data",
|
|
173
|
+
file_data: `data:${fullMediaType};base64,${convertToBase64(item.data.data)}`
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
} else if (item.data.type === "url") {
|
|
177
|
+
if (topLevel === "image") {
|
|
178
|
+
contentParts.push({
|
|
179
|
+
type: "input_image",
|
|
180
|
+
image_url: item.data.url.toString()
|
|
181
|
+
});
|
|
182
|
+
} else {
|
|
183
|
+
contentParts.push({
|
|
184
|
+
type: "input_file",
|
|
185
|
+
file_url: item.data.url.toString()
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
warnings.push({
|
|
190
|
+
type: "other",
|
|
191
|
+
message: `unsupported tool content part type: ${item.type} with data type: ${item.data.type}`
|
|
192
|
+
});
|
|
193
|
+
}
|
|
165
194
|
break;
|
|
166
195
|
}
|
|
167
196
|
default: {
|
|
@@ -196,17 +225,16 @@ async function convertToOpenResponsesInput({
|
|
|
196
225
|
}
|
|
197
226
|
|
|
198
227
|
// src/responses/open-responses-api.ts
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
code: import_v4.z.string()
|
|
228
|
+
import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
|
|
229
|
+
import { z } from "zod/v4";
|
|
230
|
+
var openResponsesErrorSchema = lazySchema(
|
|
231
|
+
() => zodSchema(
|
|
232
|
+
z.object({
|
|
233
|
+
error: z.object({
|
|
234
|
+
message: z.string(),
|
|
235
|
+
type: z.string(),
|
|
236
|
+
param: z.string(),
|
|
237
|
+
code: z.string()
|
|
210
238
|
})
|
|
211
239
|
})
|
|
212
240
|
)
|
|
@@ -230,8 +258,26 @@ function mapOpenResponsesFinishReason({
|
|
|
230
258
|
}
|
|
231
259
|
}
|
|
232
260
|
|
|
261
|
+
// src/responses/open-responses-language-model-options.ts
|
|
262
|
+
import {
|
|
263
|
+
lazySchema as lazySchema2,
|
|
264
|
+
zodSchema as zodSchema2
|
|
265
|
+
} from "@ai-sdk/provider-utils";
|
|
266
|
+
import { z as z2 } from "zod/v4";
|
|
267
|
+
var openResponsesLanguageModelOptions = lazySchema2(
|
|
268
|
+
() => zodSchema2(
|
|
269
|
+
z2.object({
|
|
270
|
+
/**
|
|
271
|
+
* Controls reasoning summary output from the model.
|
|
272
|
+
* Valid values: 'concise', 'detailed', 'auto'.
|
|
273
|
+
*/
|
|
274
|
+
reasoningSummary: z2.enum(["concise", "detailed", "auto"]).nullish()
|
|
275
|
+
})
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
|
|
233
279
|
// src/responses/open-responses-language-model.ts
|
|
234
|
-
var OpenResponsesLanguageModel = class {
|
|
280
|
+
var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
235
281
|
constructor(modelId, config) {
|
|
236
282
|
this.specificationVersion = "v4";
|
|
237
283
|
this.supportedUrls = {
|
|
@@ -240,6 +286,15 @@ var OpenResponsesLanguageModel = class {
|
|
|
240
286
|
this.modelId = modelId;
|
|
241
287
|
this.config = config;
|
|
242
288
|
}
|
|
289
|
+
static [WORKFLOW_SERIALIZE](model) {
|
|
290
|
+
return serializeModelOptions({
|
|
291
|
+
modelId: model.modelId,
|
|
292
|
+
config: model.config
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
static [WORKFLOW_DESERIALIZE](options) {
|
|
296
|
+
return new _OpenResponsesLanguageModel(options.modelId, options.config);
|
|
297
|
+
}
|
|
243
298
|
get provider() {
|
|
244
299
|
return this.config.provider;
|
|
245
300
|
}
|
|
@@ -295,7 +350,12 @@ var OpenResponsesLanguageModel = class {
|
|
|
295
350
|
strict: true
|
|
296
351
|
} : {}
|
|
297
352
|
} : void 0;
|
|
298
|
-
const
|
|
353
|
+
const openResponsesOptions = await parseProviderOptions({
|
|
354
|
+
provider: this.config.providerOptionsName,
|
|
355
|
+
providerOptions,
|
|
356
|
+
schema: openResponsesLanguageModelOptions
|
|
357
|
+
});
|
|
358
|
+
const resolvedReasoningEffort = isCustomReasoning(reasoning) ? reasoning === "none" ? "none" : mapReasoningToProviderEffort({
|
|
299
359
|
reasoning,
|
|
300
360
|
effortMap: {
|
|
301
361
|
minimal: "low",
|
|
@@ -316,7 +376,14 @@ var OpenResponsesLanguageModel = class {
|
|
|
316
376
|
top_p: topP,
|
|
317
377
|
presence_penalty: presencePenalty,
|
|
318
378
|
frequency_penalty: frequencyPenalty,
|
|
319
|
-
reasoning: resolvedReasoningEffort != null ?
|
|
379
|
+
reasoning: resolvedReasoningEffort != null || (openResponsesOptions == null ? void 0 : openResponsesOptions.reasoningSummary) != null ? {
|
|
380
|
+
...resolvedReasoningEffort != null && {
|
|
381
|
+
effort: resolvedReasoningEffort
|
|
382
|
+
},
|
|
383
|
+
...(openResponsesOptions == null ? void 0 : openResponsesOptions.reasoningSummary) != null && {
|
|
384
|
+
summary: openResponsesOptions.reasoningSummary
|
|
385
|
+
}
|
|
386
|
+
} : void 0,
|
|
320
387
|
tools: (functionTools == null ? void 0 : functionTools.length) ? functionTools : void 0,
|
|
321
388
|
tool_choice: convertedToolChoice,
|
|
322
389
|
...textFormat != null && { text: { format: textFormat } }
|
|
@@ -325,23 +392,23 @@ var OpenResponsesLanguageModel = class {
|
|
|
325
392
|
};
|
|
326
393
|
}
|
|
327
394
|
async doGenerate(options) {
|
|
328
|
-
var _a, _b, _c, _d, _e, _f;
|
|
395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
329
396
|
const { body, warnings } = await this.getArgs(options);
|
|
330
397
|
const {
|
|
331
398
|
responseHeaders,
|
|
332
399
|
value: response,
|
|
333
400
|
rawValue: rawResponse
|
|
334
|
-
} = await
|
|
401
|
+
} = await postJsonToApi({
|
|
335
402
|
url: this.config.url,
|
|
336
|
-
headers: (
|
|
403
|
+
headers: combineHeaders((_b = (_a = this.config).headers) == null ? void 0 : _b.call(_a), options.headers),
|
|
337
404
|
body,
|
|
338
|
-
failedResponseHandler:
|
|
405
|
+
failedResponseHandler: createJsonErrorResponseHandler({
|
|
339
406
|
errorSchema: openResponsesErrorSchema,
|
|
340
407
|
errorToMessage: (error) => error.error.message
|
|
341
408
|
}),
|
|
342
|
-
successfulResponseHandler:
|
|
409
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
343
410
|
// do not validate the response body, only apply types to the response body
|
|
344
|
-
|
|
411
|
+
jsonSchema(() => {
|
|
345
412
|
throw new Error("json schema not implemented");
|
|
346
413
|
})
|
|
347
414
|
),
|
|
@@ -354,7 +421,7 @@ var OpenResponsesLanguageModel = class {
|
|
|
354
421
|
switch (part.type) {
|
|
355
422
|
// TODO AI SDK 7 adjust reasoning in the specification to better support the reasoning structure from open responses.
|
|
356
423
|
case "reasoning": {
|
|
357
|
-
for (const contentPart of (
|
|
424
|
+
for (const contentPart of (_c = part.content) != null ? _c : []) {
|
|
358
425
|
content.push({
|
|
359
426
|
type: "reasoning",
|
|
360
427
|
text: contentPart.text
|
|
@@ -385,17 +452,17 @@ var OpenResponsesLanguageModel = class {
|
|
|
385
452
|
}
|
|
386
453
|
const usage = response.usage;
|
|
387
454
|
const inputTokens = usage == null ? void 0 : usage.input_tokens;
|
|
388
|
-
const cachedInputTokens = (
|
|
455
|
+
const cachedInputTokens = (_d = usage == null ? void 0 : usage.input_tokens_details) == null ? void 0 : _d.cached_tokens;
|
|
389
456
|
const outputTokens = usage == null ? void 0 : usage.output_tokens;
|
|
390
|
-
const reasoningTokens = (
|
|
457
|
+
const reasoningTokens = (_e = usage == null ? void 0 : usage.output_tokens_details) == null ? void 0 : _e.reasoning_tokens;
|
|
391
458
|
return {
|
|
392
459
|
content,
|
|
393
460
|
finishReason: {
|
|
394
461
|
unified: mapOpenResponsesFinishReason({
|
|
395
|
-
finishReason: (
|
|
462
|
+
finishReason: (_f = response.incomplete_details) == null ? void 0 : _f.reason,
|
|
396
463
|
hasToolCalls
|
|
397
464
|
}),
|
|
398
|
-
raw: (
|
|
465
|
+
raw: (_h = (_g = response.incomplete_details) == null ? void 0 : _g.reason) != null ? _h : void 0
|
|
399
466
|
},
|
|
400
467
|
usage: {
|
|
401
468
|
inputTokens: {
|
|
@@ -424,20 +491,21 @@ var OpenResponsesLanguageModel = class {
|
|
|
424
491
|
};
|
|
425
492
|
}
|
|
426
493
|
async doStream(options) {
|
|
494
|
+
var _a, _b;
|
|
427
495
|
const { body, warnings } = await this.getArgs(options);
|
|
428
|
-
const { responseHeaders, value: response } = await
|
|
496
|
+
const { responseHeaders, value: response } = await postJsonToApi({
|
|
429
497
|
url: this.config.url,
|
|
430
|
-
headers: (
|
|
498
|
+
headers: combineHeaders((_b = (_a = this.config).headers) == null ? void 0 : _b.call(_a), options.headers),
|
|
431
499
|
body: {
|
|
432
500
|
...body,
|
|
433
501
|
stream: true
|
|
434
502
|
},
|
|
435
|
-
failedResponseHandler:
|
|
503
|
+
failedResponseHandler: createJsonErrorResponseHandler({
|
|
436
504
|
errorSchema: openResponsesErrorSchema,
|
|
437
505
|
errorToMessage: (error) => error.error.message
|
|
438
506
|
}),
|
|
439
507
|
// TODO consider validation
|
|
440
|
-
successfulResponseHandler:
|
|
508
|
+
successfulResponseHandler: createEventSourceResponseHandler(z3.any()),
|
|
441
509
|
abortSignal: options.abortSignal,
|
|
442
510
|
fetch: this.config.fetch
|
|
443
511
|
});
|
|
@@ -455,14 +523,14 @@ var OpenResponsesLanguageModel = class {
|
|
|
455
523
|
}
|
|
456
524
|
};
|
|
457
525
|
const updateUsage = (responseUsage) => {
|
|
458
|
-
var
|
|
526
|
+
var _a2, _b2;
|
|
459
527
|
if (!responseUsage) {
|
|
460
528
|
return;
|
|
461
529
|
}
|
|
462
530
|
const inputTokens = responseUsage.input_tokens;
|
|
463
|
-
const cachedInputTokens = (
|
|
531
|
+
const cachedInputTokens = (_a2 = responseUsage.input_tokens_details) == null ? void 0 : _a2.cached_tokens;
|
|
464
532
|
const outputTokens = responseUsage.output_tokens;
|
|
465
|
-
const reasoningTokens = (
|
|
533
|
+
const reasoningTokens = (_b2 = responseUsage.output_tokens_details) == null ? void 0 : _b2.reasoning_tokens;
|
|
466
534
|
usage.inputTokens = {
|
|
467
535
|
total: inputTokens,
|
|
468
536
|
noCache: (inputTokens != null ? inputTokens : 0) - (cachedInputTokens != null ? cachedInputTokens : 0),
|
|
@@ -490,7 +558,7 @@ var OpenResponsesLanguageModel = class {
|
|
|
490
558
|
controller.enqueue({ type: "stream-start", warnings });
|
|
491
559
|
},
|
|
492
560
|
transform(parseResult, controller) {
|
|
493
|
-
var
|
|
561
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
494
562
|
if (options.includeRawChunks) {
|
|
495
563
|
controller.enqueue({
|
|
496
564
|
type: "raw",
|
|
@@ -510,8 +578,8 @@ var OpenResponsesLanguageModel = class {
|
|
|
510
578
|
};
|
|
511
579
|
} else if (chunk.type === "response.function_call_arguments.delta") {
|
|
512
580
|
const functionCallChunk = chunk;
|
|
513
|
-
const toolCall = (
|
|
514
|
-
toolCall.arguments = ((
|
|
581
|
+
const toolCall = (_a2 = toolCallsByItemId[functionCallChunk.item_id]) != null ? _a2 : toolCallsByItemId[functionCallChunk.item_id] = {};
|
|
582
|
+
toolCall.arguments = ((_b2 = toolCall.arguments) != null ? _b2 : "") + functionCallChunk.delta;
|
|
515
583
|
} else if (chunk.type === "response.function_call_arguments.done") {
|
|
516
584
|
const functionCallChunk = chunk;
|
|
517
585
|
const toolCall = (_c = toolCallsByItemId[functionCallChunk.item_id]) != null ? _c : toolCallsByItemId[functionCallChunk.item_id] = {};
|
|
@@ -595,7 +663,7 @@ var OpenResponsesLanguageModel = class {
|
|
|
595
663
|
// src/open-responses-provider.ts
|
|
596
664
|
function createOpenResponses(options) {
|
|
597
665
|
const providerName = options.name;
|
|
598
|
-
const getHeaders = () =>
|
|
666
|
+
const getHeaders = () => withUserAgentSuffix(
|
|
599
667
|
{
|
|
600
668
|
...options.apiKey ? {
|
|
601
669
|
Authorization: `Bearer ${options.apiKey}`
|
|
@@ -607,10 +675,11 @@ function createOpenResponses(options) {
|
|
|
607
675
|
const createResponsesModel = (modelId) => {
|
|
608
676
|
return new OpenResponsesLanguageModel(modelId, {
|
|
609
677
|
provider: `${providerName}.responses`,
|
|
678
|
+
providerOptionsName: providerName,
|
|
610
679
|
headers: getHeaders,
|
|
611
680
|
url: options.url,
|
|
612
681
|
fetch: options.fetch,
|
|
613
|
-
generateId: () =>
|
|
682
|
+
generateId: () => generateId()
|
|
614
683
|
});
|
|
615
684
|
};
|
|
616
685
|
const createLanguageModel = (modelId) => {
|
|
@@ -627,16 +696,15 @@ function createOpenResponses(options) {
|
|
|
627
696
|
provider.specificationVersion = "v4";
|
|
628
697
|
provider.languageModel = createLanguageModel;
|
|
629
698
|
provider.embeddingModel = (modelId) => {
|
|
630
|
-
throw new
|
|
699
|
+
throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });
|
|
631
700
|
};
|
|
632
701
|
provider.imageModel = (modelId) => {
|
|
633
|
-
throw new
|
|
702
|
+
throw new NoSuchModelError({ modelId, modelType: "imageModel" });
|
|
634
703
|
};
|
|
635
704
|
return provider;
|
|
636
705
|
}
|
|
637
|
-
|
|
638
|
-
0 && (module.exports = {
|
|
706
|
+
export {
|
|
639
707
|
VERSION,
|
|
640
708
|
createOpenResponses
|
|
641
|
-
}
|
|
709
|
+
};
|
|
642
710
|
//# sourceMappingURL=index.js.map
|