@ai-sdk/google 4.0.86 → 4.0.87

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.
@@ -2235,10 +2235,13 @@ function isConfirmedPromptBlockReason(blockReason) {
2235
2235
  * encoded audio in the first inline-data part (WAV by default on Gemini 3.8,
2236
2236
  * raw PCM on older models).
2237
2237
  */
2238
- const googleSpeechResponseSchema = lazySchema(() => zodSchema(z.object({ candidates: z.array(z.object({ content: z.object({ parts: z.array(z.object({ inlineData: z.object({
2239
- mimeType: z.string().nullish(),
2240
- data: z.string().nullish()
2241
- }).nullish() })).nullish() }).nullish() })).nullish() })));
2238
+ const googleSpeechResponseSchema = lazySchema(() => zodSchema(z.object({
2239
+ candidates: z.array(z.object({ content: z.object({ parts: z.array(z.object({ inlineData: z.object({
2240
+ mimeType: z.string().nullish(),
2241
+ data: z.string().nullish()
2242
+ }).nullish() })).nullish() }).nullish() })).nullish(),
2243
+ usageMetadata: z.record(z.string(), z.json()).nullish()
2244
+ })));
2242
2245
  //#endregion
2243
2246
  //#region src/google-speech-input.ts
2244
2247
  /**
@@ -2479,6 +2482,7 @@ var GoogleSpeechModel = class GoogleSpeechModel {
2479
2482
  return {
2480
2483
  audio,
2481
2484
  warnings,
2485
+ ...response.usageMetadata != null && { usage: response.usageMetadata },
2482
2486
  request: { body: JSON.stringify(requestBody) },
2483
2487
  response: {
2484
2488
  timestamp: currentDate,