You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@ai-sdk/xai

Package Overview
Dependencies
Maintainers
3
Versions
342
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
4.0.0-beta.14
to
4.0.0-beta.15
+8
-0
CHANGELOG.md
# @ai-sdk/xai
## 4.0.0-beta.15
### Patch Changes
- 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
- Updated dependencies [74d520f]
- @ai-sdk/openai-compatible@3.0.0-beta.9
## 4.0.0-beta.14

@@ -4,0 +12,0 @@

+2
-2
{
"name": "@ai-sdk/xai",
"version": "4.0.0-beta.14",
"version": "4.0.0-beta.15",
"license": "Apache-2.0",

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

"dependencies": {
"@ai-sdk/openai-compatible": "3.0.0-beta.9",
"@ai-sdk/provider": "4.0.0-beta.4",
"@ai-sdk/openai-compatible": "3.0.0-beta.8",
"@ai-sdk/provider-utils": "5.0.0-beta.6"

@@ -36,0 +36,0 @@ },

@@ -17,2 +17,4 @@ import {

FetchFunction,
isCustomReasoning,
mapReasoningToProviderEffort,
parseProviderOptions,

@@ -78,2 +80,3 @@ ParseResult,

toolChoice,
reasoning,
}: LanguageModelV4CallOptions) {

@@ -144,2 +147,20 @@ const warnings: SharedV4Warning[] = [];

const resolvedReasoningEffort =
options.reasoningEffort ??
(isCustomReasoning(reasoning)
? reasoning === 'none'
? undefined
: mapReasoningToProviderEffort({
reasoning,
effortMap: {
minimal: 'low',
low: 'low',
medium: 'medium',
high: 'high',
xhigh: 'high',
},
warnings,
})
: undefined);
const baseArgs: Record<string, unknown> = {

@@ -171,7 +192,7 @@ model: this.modelId,

}),
...((options.reasoningEffort != null ||
...((resolvedReasoningEffort != null ||
options.reasoningSummary != null) && {
reasoning: {
...(options.reasoningEffort != null && {
effort: options.reasoningEffort,
...(resolvedReasoningEffort != null && {
effort: resolvedReasoningEffort,
}),

@@ -178,0 +199,0 @@ ...(options.reasoningSummary != null && {

@@ -19,2 +19,4 @@ import {

FetchFunction,
isCustomReasoning,
mapReasoningToProviderEffort,
parseProviderOptions,

@@ -75,2 +77,3 @@ ParseResult,

seed,
reasoning,
responseFormat,

@@ -138,3 +141,19 @@ providerOptions,

seed,
reasoning_effort: options.reasoningEffort,
reasoning_effort:
options.reasoningEffort ??
(isCustomReasoning(reasoning)
? reasoning === 'none'
? undefined
: mapReasoningToProviderEffort({
reasoning,
effortMap: {
minimal: 'low',
low: 'low',
medium: 'low',
high: 'high',
xhigh: 'high',
},
warnings,
})
: undefined),

@@ -141,0 +160,0 @@ // parallel function calling

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