@ai-sdk/openai-compatible 2.0.14 → 2.0.15
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 +29 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ai-sdk/openai-compatible
|
|
2
2
|
|
|
3
|
+
## 2.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7116ef3: Use consistent camelCase `openaiCompatible` key for providerOptions. The kebab-case `openai-compatible` key is now deprecated but still supported with a console warning.
|
|
8
|
+
|
|
3
9
|
## 2.0.14
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -442,9 +442,21 @@ var OpenAICompatibleChatLanguageModel = class {
|
|
|
442
442
|
}) {
|
|
443
443
|
var _a, _b, _c, _d, _e;
|
|
444
444
|
const warnings = [];
|
|
445
|
+
const deprecatedOptions = await (0, import_provider_utils2.parseProviderOptions)({
|
|
446
|
+
provider: "openai-compatible",
|
|
447
|
+
providerOptions,
|
|
448
|
+
schema: openaiCompatibleProviderOptions
|
|
449
|
+
});
|
|
450
|
+
if (deprecatedOptions != null) {
|
|
451
|
+
warnings.push({
|
|
452
|
+
type: "other",
|
|
453
|
+
message: `The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead.`
|
|
454
|
+
});
|
|
455
|
+
}
|
|
445
456
|
const compatibleOptions = Object.assign(
|
|
457
|
+
deprecatedOptions != null ? deprecatedOptions : {},
|
|
446
458
|
(_a = await (0, import_provider_utils2.parseProviderOptions)({
|
|
447
|
-
provider: "
|
|
459
|
+
provider: "openaiCompatible",
|
|
448
460
|
providerOptions,
|
|
449
461
|
schema: openaiCompatibleProviderOptions
|
|
450
462
|
})) != null ? _a : {},
|
|
@@ -1430,9 +1442,22 @@ var OpenAICompatibleEmbeddingModel = class {
|
|
|
1430
1442
|
providerOptions
|
|
1431
1443
|
}) {
|
|
1432
1444
|
var _a, _b, _c;
|
|
1445
|
+
const warnings = [];
|
|
1446
|
+
const deprecatedOptions = await (0, import_provider_utils4.parseProviderOptions)({
|
|
1447
|
+
provider: "openai-compatible",
|
|
1448
|
+
providerOptions,
|
|
1449
|
+
schema: openaiCompatibleEmbeddingProviderOptions
|
|
1450
|
+
});
|
|
1451
|
+
if (deprecatedOptions != null) {
|
|
1452
|
+
warnings.push({
|
|
1453
|
+
type: "other",
|
|
1454
|
+
message: `The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead.`
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1433
1457
|
const compatibleOptions = Object.assign(
|
|
1458
|
+
deprecatedOptions != null ? deprecatedOptions : {},
|
|
1434
1459
|
(_a = await (0, import_provider_utils4.parseProviderOptions)({
|
|
1435
|
-
provider: "
|
|
1460
|
+
provider: "openaiCompatible",
|
|
1436
1461
|
providerOptions,
|
|
1437
1462
|
schema: openaiCompatibleEmbeddingProviderOptions
|
|
1438
1463
|
})) != null ? _a : {},
|
|
@@ -1477,7 +1502,7 @@ var OpenAICompatibleEmbeddingModel = class {
|
|
|
1477
1502
|
fetch: this.config.fetch
|
|
1478
1503
|
});
|
|
1479
1504
|
return {
|
|
1480
|
-
warnings
|
|
1505
|
+
warnings,
|
|
1481
1506
|
embeddings: response.data.map((item) => item.embedding),
|
|
1482
1507
|
usage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,
|
|
1483
1508
|
providerMetadata: response.providerMetadata,
|
|
@@ -1613,7 +1638,7 @@ async function fileToBlob(file) {
|
|
|
1613
1638
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
1614
1639
|
|
|
1615
1640
|
// src/version.ts
|
|
1616
|
-
var VERSION = true ? "2.0.
|
|
1641
|
+
var VERSION = true ? "2.0.15" : "0.0.0-test";
|
|
1617
1642
|
|
|
1618
1643
|
// src/openai-compatible-provider.ts
|
|
1619
1644
|
function createOpenAICompatible(options) {
|