@ai-sdk/xai 5.0.15 → 5.0.16
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/xai",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ai-sdk/provider": "4.0.
|
|
33
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
32
|
+
"@ai-sdk/provider": "4.0.23",
|
|
33
|
+
"@ai-sdk/provider-utils": "5.0.55"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@ai-sdk/test-server": "2.0.
|
|
36
|
+
"@ai-sdk/test-server": "2.0.4",
|
|
37
37
|
"@types/node": "22.19.19",
|
|
38
38
|
"@vercel/ai-tsconfig": "0.0.0",
|
|
39
39
|
"tsdown": "^0.23.0",
|
|
40
|
-
"typescript": "
|
|
40
|
+
"typescript": "6.0.3",
|
|
41
41
|
"zod": "3.25.76"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
package/src/files/xai-files.ts
CHANGED
|
@@ -152,7 +152,7 @@ export class XaiFiles implements FilesV4 {
|
|
|
152
152
|
} else {
|
|
153
153
|
const fileBytes = convertInlineFileDataToUint8Array(data);
|
|
154
154
|
|
|
155
|
-
const blob = new Blob([fileBytes], {
|
|
155
|
+
const blob = new Blob([fileBytes as Uint8Array<ArrayBuffer>], {
|
|
156
156
|
type: mediaType,
|
|
157
157
|
});
|
|
158
158
|
|
|
@@ -101,7 +101,7 @@ export class XaiTranscriptionModel implements TranscriptionModelV4 {
|
|
|
101
101
|
|
|
102
102
|
const blob =
|
|
103
103
|
audio instanceof Uint8Array
|
|
104
|
-
? new Blob([audio])
|
|
104
|
+
? new Blob([audio as Uint8Array<ArrayBuffer>])
|
|
105
105
|
: new Blob([convertBase64ToUint8Array(audio)]);
|
|
106
106
|
const fileExtension = mediaTypeToExtension(mediaType);
|
|
107
107
|
|
|
@@ -154,6 +154,13 @@ export class XaiTranscriptionModel implements TranscriptionModelV4 {
|
|
|
154
154
|
headers: responseHeaders,
|
|
155
155
|
body: rawResponse,
|
|
156
156
|
},
|
|
157
|
+
...(response.words?.some(word => word.speaker != null) && {
|
|
158
|
+
providerMetadata: {
|
|
159
|
+
xai: {
|
|
160
|
+
words: response.words,
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
}),
|
|
157
164
|
};
|
|
158
165
|
}
|
|
159
166
|
|
|
@@ -541,6 +548,7 @@ const xaiTranscriptionResponseSchema = z.object({
|
|
|
541
548
|
text: z.string(),
|
|
542
549
|
start: z.number(),
|
|
543
550
|
end: z.number(),
|
|
551
|
+
speaker: z.number().nullish(),
|
|
544
552
|
}),
|
|
545
553
|
)
|
|
546
554
|
.nullish(),
|