@ai-sdk/xai 3.0.110 → 3.0.112
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 +12 -0
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/responses/convert-to-xai-responses-input.ts +37 -8
- package/src/responses/xai-responses-api.ts +12 -1
- package/src/responses/xai-responses-language-model.ts +15 -0
package/dist/index.mjs
CHANGED
|
@@ -1279,12 +1279,42 @@ async function convertToXaiResponsesInput({
|
|
|
1279
1279
|
outputValue = JSON.stringify(output.value);
|
|
1280
1280
|
break;
|
|
1281
1281
|
case "content":
|
|
1282
|
-
outputValue =
|
|
1283
|
-
|
|
1284
|
-
|
|
1282
|
+
outputValue = [];
|
|
1283
|
+
for (const item of output.value) {
|
|
1284
|
+
switch (item.type) {
|
|
1285
|
+
case "text": {
|
|
1286
|
+
outputValue.push({
|
|
1287
|
+
type: "input_text",
|
|
1288
|
+
text: item.text
|
|
1289
|
+
});
|
|
1290
|
+
break;
|
|
1291
|
+
}
|
|
1292
|
+
case "image-data": {
|
|
1293
|
+
outputValue.push({
|
|
1294
|
+
type: "input_image",
|
|
1295
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
1296
|
+
});
|
|
1297
|
+
break;
|
|
1298
|
+
}
|
|
1299
|
+
case "image-url": {
|
|
1300
|
+
outputValue.push({
|
|
1301
|
+
type: "input_image",
|
|
1302
|
+
image_url: item.url
|
|
1303
|
+
});
|
|
1304
|
+
break;
|
|
1305
|
+
}
|
|
1306
|
+
case "file-data":
|
|
1307
|
+
case "file-url":
|
|
1308
|
+
case "file-id":
|
|
1309
|
+
case "image-file-id":
|
|
1310
|
+
case "custom": {
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
default: {
|
|
1314
|
+
const _exhaustiveCheck = item;
|
|
1315
|
+
}
|
|
1285
1316
|
}
|
|
1286
|
-
|
|
1287
|
-
}).join("");
|
|
1317
|
+
}
|
|
1288
1318
|
break;
|
|
1289
1319
|
default: {
|
|
1290
1320
|
const _exhaustiveCheck = output;
|
|
@@ -2141,6 +2171,9 @@ var XaiResponsesLanguageModel = class {
|
|
|
2141
2171
|
maxOutputTokens,
|
|
2142
2172
|
temperature,
|
|
2143
2173
|
topP,
|
|
2174
|
+
topK,
|
|
2175
|
+
frequencyPenalty,
|
|
2176
|
+
presencePenalty,
|
|
2144
2177
|
stopSequences,
|
|
2145
2178
|
seed,
|
|
2146
2179
|
responseFormat,
|
|
@@ -2155,6 +2188,15 @@ var XaiResponsesLanguageModel = class {
|
|
|
2155
2188
|
providerOptions,
|
|
2156
2189
|
schema: xaiLanguageModelResponsesOptions
|
|
2157
2190
|
})) != null ? _a : {};
|
|
2191
|
+
if (topK != null) {
|
|
2192
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
2193
|
+
}
|
|
2194
|
+
if (frequencyPenalty != null) {
|
|
2195
|
+
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
2196
|
+
}
|
|
2197
|
+
if (presencePenalty != null) {
|
|
2198
|
+
warnings.push({ type: "unsupported", feature: "presencePenalty" });
|
|
2199
|
+
}
|
|
2158
2200
|
if (stopSequences != null) {
|
|
2159
2201
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
2160
2202
|
}
|
|
@@ -2912,7 +2954,7 @@ var xaiTools = {
|
|
|
2912
2954
|
};
|
|
2913
2955
|
|
|
2914
2956
|
// src/version.ts
|
|
2915
|
-
var VERSION = true ? "3.0.
|
|
2957
|
+
var VERSION = true ? "3.0.112" : "0.0.0-test";
|
|
2916
2958
|
|
|
2917
2959
|
// src/xai-video-model.ts
|
|
2918
2960
|
import {
|