@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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 5.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 268225c: feat(provider): add a portable `max` reasoning level with native provider mappings, compatibility coercions, and budget-based fallback support.
8
+
9
+ Compatibility notes:
10
+
11
+ - **TypeScript source compatibility:** Adding `max` widens `LanguageModelV4CallOptions['reasoning']` and the derived `ReasoningLevel` type. Third-party providers and consumers with exhaustive switches or `Record<ReasoningLevel, ...>` mappings must handle `max` before upgrading. Ordinary calls using existing reasoning levels remain accepted.
12
+ - **Amazon Bedrock:** Existing Nova 2 calls using portable `reasoning: 'xhigh'` now send `maxReasoningEffort: 'high'` instead of the unsupported `'max'`, and return a compatibility warning. Anthropic and OpenAI Bedrock effort mappings retain their existing `xhigh` behavior. Partial Bedrock reasoning configurations continue to preserve explicit values and derive missing fields; explicit effort/budget overrides and disabled thinking no longer emit warnings for portable mappings that are not sent.
13
+ - **Fireworks:** Existing portable `minimal` and `xhigh` calls keep their request mappings to `low` and `high`, respectively, and now return compatibility warnings in generation and streaming results. Portable `max` maps to `high` with the same warning behavior.
14
+
15
+ **Release classification:** This remains a patch changeset under the repository's explicit release policy, which uses patch releases for both fixes and features. The TypeScript source-compatibility caveat for exhaustive consumers is disclosed above. Maintainers can override this classification with a `major` label if they decide to align the provider-spec addition with a future AI SDK major release.
16
+
17
+ - 0af2f7c: chore: upgrade to TypeScript 6
18
+ - 0c82824: fix(xai): preserve or report unavailable speaker diarization
19
+ - Updated dependencies [fc1e19e]
20
+ - Updated dependencies [5094ebd]
21
+ - Updated dependencies [268225c]
22
+ - Updated dependencies [0af2f7c]
23
+ - @ai-sdk/provider-utils@5.0.55
24
+ - @ai-sdk/provider@4.0.23
25
+
3
26
  ## 5.0.15
4
27
 
5
28
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1427,7 +1427,8 @@ var XaiResponsesLanguageModel = class XaiResponsesLanguageModel {
1427
1427
  low: "low",
1428
1428
  medium: "medium",
1429
1429
  high: "high",
1430
- xhigh: modelId === "grok-4.6" ? "xhigh" : "high"
1430
+ xhigh: modelId === "grok-4.6" ? "xhigh" : "high",
1431
+ max: modelId === "grok-4.6" ? "xhigh" : "high"
1431
1432
  },
1432
1433
  warnings
1433
1434
  });
@@ -3087,7 +3088,7 @@ const xaiTools = {
3087
3088
  };
3088
3089
  //#endregion
3089
3090
  //#region src/version.ts
3090
- const VERSION = "5.0.15";
3091
+ const VERSION = "5.0.16";
3091
3092
  //#endregion
3092
3093
  //#region src/files/xai-files-options.ts
3093
3094
  const xaiFilesOptionsSchema = lazySchema(() => zodSchema(z.looseObject({
@@ -4085,7 +4086,8 @@ var XaiTranscriptionModel = class XaiTranscriptionModel {
4085
4086
  modelId: this.modelId,
4086
4087
  headers: responseHeaders,
4087
4088
  body: rawResponse
4088
- }
4089
+ },
4090
+ ...response.words?.some((word) => word.speaker != null) && { providerMetadata: { xai: { words: response.words } } }
4089
4091
  };
4090
4092
  }
4091
4093
  async doStream(options) {
@@ -4324,7 +4326,8 @@ const xaiTranscriptionResponseSchema = z.object({
4324
4326
  words: z.array(z.object({
4325
4327
  text: z.string(),
4326
4328
  start: z.number(),
4327
- end: z.number()
4329
+ end: z.number(),
4330
+ speaker: z.number().nullish()
4328
4331
  })).nullish()
4329
4332
  });
4330
4333
  //#endregion