@ai-sdk/xai 4.0.33 → 4.0.34
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 +8 -0
- package/dist/index.d.ts +40 -1
- package/dist/index.js +378 -200
- package/dist/index.js.map +1 -1
- package/docs/01-xai.mdx +41 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/responses/xai-responses-api.ts +26 -0
- package/src/responses/xai-responses-language-model.ts +137 -0
- package/src/responses/xai-responses-prepare-tools.ts +14 -0
- package/src/tool/image-generation.ts +62 -0
- package/src/tool/index.ts +3 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -239,6 +239,36 @@ declare const codeExecution: (args?: Parameters<typeof codeExecutionToolFactory>
|
|
|
239
239
|
error?: string | undefined;
|
|
240
240
|
}, {}>;
|
|
241
241
|
|
|
242
|
+
declare const imageGenerationToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
243
|
+
/**
|
|
244
|
+
* The generated image encoded in base64.
|
|
245
|
+
*/
|
|
246
|
+
result: string;
|
|
247
|
+
/**
|
|
248
|
+
* The prompt that the model wrote for the image model.
|
|
249
|
+
*/
|
|
250
|
+
prompt?: string;
|
|
251
|
+
}, {
|
|
252
|
+
/**
|
|
253
|
+
* Restricts what the tool can do. Defaults to 'auto'.
|
|
254
|
+
*
|
|
255
|
+
* - 'auto': the model can generate and edit images.
|
|
256
|
+
* - 'generate': text-to-image generation only.
|
|
257
|
+
* - 'edit': image editing only.
|
|
258
|
+
*/
|
|
259
|
+
action?: "auto" | "generate" | "edit";
|
|
260
|
+
}, {}>;
|
|
261
|
+
declare const imageGeneration: (args?: Parameters<typeof imageGenerationToolFactory>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
262
|
+
/**
|
|
263
|
+
* The generated image encoded in base64.
|
|
264
|
+
*/
|
|
265
|
+
result: string;
|
|
266
|
+
/**
|
|
267
|
+
* The prompt that the model wrote for the image model.
|
|
268
|
+
*/
|
|
269
|
+
prompt?: string;
|
|
270
|
+
}, {}>;
|
|
271
|
+
|
|
242
272
|
declare const mcpServerToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
243
273
|
name: string;
|
|
244
274
|
arguments: string;
|
|
@@ -353,6 +383,15 @@ declare const xaiTools: {
|
|
|
353
383
|
text: string;
|
|
354
384
|
}[];
|
|
355
385
|
}, {}>;
|
|
386
|
+
imageGeneration: (args?: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
387
|
+
result: string;
|
|
388
|
+
prompt?: string;
|
|
389
|
+
}, {
|
|
390
|
+
action?: "auto" | "generate" | "edit";
|
|
391
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
392
|
+
result: string;
|
|
393
|
+
prompt?: string;
|
|
394
|
+
}, {}>;
|
|
356
395
|
mcpServer: (args: Parameters<_ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {
|
|
357
396
|
name: string;
|
|
358
397
|
arguments: string;
|
|
@@ -545,4 +584,4 @@ declare class XaiRealtimeModel implements Experimental_RealtimeModelV4 {
|
|
|
545
584
|
|
|
546
585
|
declare const VERSION: string;
|
|
547
586
|
|
|
548
|
-
export { XaiRealtimeModel as Experimental_XaiRealtimeModel, type XaiRealtimeModelConfig as Experimental_XaiRealtimeModelConfig, VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiSpeechModelOptions, type XaiTranscriptionModelOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
|
587
|
+
export { XaiRealtimeModel as Experimental_XaiRealtimeModel, type XaiRealtimeModelConfig as Experimental_XaiRealtimeModelConfig, VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiSpeechModelOptions, type XaiTranscriptionModelOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, imageGeneration, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|