🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ai-sdk/xai

Package Overview
Dependencies
Maintainers
3
Versions
477
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/xai - npm Package Compare versions

Comparing version
3.0.108
to
3.0.109
+6
-0
CHANGELOG.md
# @ai-sdk/xai
## 3.0.109
### Patch Changes
- b0db900: feat(provider/xai): support end-user identifiers for video generation and editing
## 3.0.108

@@ -4,0 +10,0 @@

+11
-5

@@ -125,4 +125,10 @@ import { z } from 'zod/v4';

}
interface XaiVideoEditModeOptions extends XaiVideoSharedOptions {
interface XaiVideoUserOptions {
/**
* A unique identifier representing the end user, for abuse monitoring.
*/
user?: string;
}
interface XaiVideoEditModeOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**
* Select edit-video mode explicitly for best autocomplete and narrowing.

@@ -142,3 +148,3 @@ */

}
interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -151,3 +157,3 @@ * Select reference-to-video mode explicitly for best autocomplete and narrowing.

}
interface XaiVideoGenerationOptions extends XaiVideoSharedOptions {
interface XaiVideoGenerationOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
mode?: undefined;

@@ -157,3 +163,3 @@ videoUrl?: undefined;

}
interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -166,3 +172,3 @@ * Legacy backward-compatible shape: omitting `mode` while providing

}
interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -169,0 +175,0 @@ * Legacy backward-compatible shape: omitting `mode` while providing

@@ -125,4 +125,10 @@ import { z } from 'zod/v4';

}
interface XaiVideoEditModeOptions extends XaiVideoSharedOptions {
interface XaiVideoUserOptions {
/**
* A unique identifier representing the end user, for abuse monitoring.
*/
user?: string;
}
interface XaiVideoEditModeOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**
* Select edit-video mode explicitly for best autocomplete and narrowing.

@@ -142,3 +148,3 @@ */

}
interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -151,3 +157,3 @@ * Select reference-to-video mode explicitly for best autocomplete and narrowing.

}
interface XaiVideoGenerationOptions extends XaiVideoSharedOptions {
interface XaiVideoGenerationOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
mode?: undefined;

@@ -157,3 +163,3 @@ videoUrl?: undefined;

}
interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -166,3 +172,3 @@ * Legacy backward-compatible shape: omitting `mode` while providing

}
interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -169,0 +175,0 @@ * Legacy backward-compatible shape: omitting `mode` while providing

{
"name": "@ai-sdk/xai",
"version": "3.0.108",
"version": "3.0.109",
"license": "Apache-2.0",

@@ -32,5 +32,5 @@ "sideEffects": false,

"dependencies": {
"@ai-sdk/provider": "3.0.14",
"@ai-sdk/openai-compatible": "2.0.61",
"@ai-sdk/provider-utils": "4.0.39",
"@ai-sdk/openai-compatible": "2.0.61"
"@ai-sdk/provider": "3.0.14"
},

@@ -37,0 +37,0 @@ "devDependencies": {

@@ -366,2 +366,6 @@ import {

if (!isExtension && xaiOptions?.user !== undefined) {
body.user = xaiOptions.user;
}
if (xaiOptions != null) {

@@ -377,2 +381,3 @@ for (const [key, value] of Object.entries(xaiOptions)) {

'referenceImageUrls',
'user',
].includes(key)

@@ -379,0 +384,0 @@ ) {

@@ -17,4 +17,12 @@ import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';

interface XaiVideoEditModeOptions extends XaiVideoSharedOptions {
interface XaiVideoUserOptions {
/**
* A unique identifier representing the end user, for abuse monitoring.
*/
user?: string;
}
interface XaiVideoEditModeOptions
extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**
* Select edit-video mode explicitly for best autocomplete and narrowing.

@@ -36,3 +44,4 @@ */

interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiVideoReferenceToVideoOptions
extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -46,3 +55,4 @@ * Select reference-to-video mode explicitly for best autocomplete and narrowing.

interface XaiVideoGenerationOptions extends XaiVideoSharedOptions {
interface XaiVideoGenerationOptions
extends XaiVideoSharedOptions, XaiVideoUserOptions {
mode?: undefined;

@@ -53,3 +63,4 @@ videoUrl?: undefined;

interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyEditVideoOptions
extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -63,3 +74,4 @@ * Legacy backward-compatible shape: omitting `mode` while providing

interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
interface XaiLegacyReferenceToVideoOptions
extends XaiVideoSharedOptions, XaiVideoUserOptions {
/**

@@ -102,4 +114,9 @@ * Legacy backward-compatible shape: omitting `mode` while providing

const userField = {
user: z.string().optional(),
};
const editVideoSchema = z.object({
...baseFields,
...userField,
mode: z.literal('edit-video'),

@@ -119,2 +136,3 @@ videoUrl: nonEmptyStringSchema,

...baseFields,
...userField,
mode: z.literal('reference-to-video'),

@@ -127,2 +145,3 @@ referenceImageUrls: z.array(nonEmptyStringSchema).min(1).max(7),

...baseFields,
...userField,
mode: z.undefined().optional(),

@@ -145,2 +164,3 @@ videoUrl: nonEmptyStringSchema.optional(),

referenceImageUrls: z.array(nonEmptyStringSchema).min(1).max(7).optional(),
user: z.string().optional(),
...baseFields,

@@ -147,0 +167,0 @@ })

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet