@ai-sdk/openai 3.0.129 → 3.0.131

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,22 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 3.0.131
4
+
5
+ ### Patch Changes
6
+
7
+ - 6afa8a8: Defer validation schema construction until first use to reduce provider import time.
8
+ - aad3b66: feat(openai): support 12h prompt cache writes and cache prewarming
9
+ - Updated dependencies [1183cc4]
10
+ - Updated dependencies [d726591]
11
+ - @ai-sdk/provider-utils@4.0.62
12
+
13
+ ## 3.0.130
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [5aa3086]
18
+ - @ai-sdk/provider-utils@4.0.61
19
+
3
20
  ## 3.0.129
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -244,6 +244,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
244
244
  input_tokens_details?: (Record<string, JSONValue | undefined> & {
245
245
  cached_tokens?: number | null | undefined;
246
246
  cache_write_tokens?: number | null | undefined;
247
+ cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
248
+ ttl_30m_tokens?: number | null | undefined;
249
+ ttl_12h_tokens?: number | null | undefined;
250
+ }) | null | undefined;
247
251
  orchestration_input_tokens?: number | null | undefined;
248
252
  orchestration_input_cached_tokens?: number | null | undefined;
249
253
  }) | null | undefined;
@@ -275,6 +279,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
275
279
  input_tokens_details?: (Record<string, JSONValue | undefined> & {
276
280
  cached_tokens?: number | null | undefined;
277
281
  cache_write_tokens?: number | null | undefined;
282
+ cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
283
+ ttl_30m_tokens?: number | null | undefined;
284
+ ttl_12h_tokens?: number | null | undefined;
285
+ }) | null | undefined;
278
286
  orchestration_input_tokens?: number | null | undefined;
279
287
  orchestration_input_cached_tokens?: number | null | undefined;
280
288
  }) | null | undefined;
@@ -1105,7 +1113,8 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
1105
1113
  promptCacheKey?: string | null | undefined;
1106
1114
  promptCacheOptions?: {
1107
1115
  mode?: "explicit" | "implicit" | undefined;
1108
- ttl?: "30m" | undefined;
1116
+ ttl?: "30m" | "12h" | undefined;
1117
+ prewarm?: boolean | undefined;
1109
1118
  } | undefined;
1110
1119
  promptCacheRetention?: "in_memory" | "24h" | null | undefined;
1111
1120
  reasoningEffort?: string | null | undefined;
package/dist/index.d.ts CHANGED
@@ -244,6 +244,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
244
244
  input_tokens_details?: (Record<string, JSONValue | undefined> & {
245
245
  cached_tokens?: number | null | undefined;
246
246
  cache_write_tokens?: number | null | undefined;
247
+ cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
248
+ ttl_30m_tokens?: number | null | undefined;
249
+ ttl_12h_tokens?: number | null | undefined;
250
+ }) | null | undefined;
247
251
  orchestration_input_tokens?: number | null | undefined;
248
252
  orchestration_input_cached_tokens?: number | null | undefined;
249
253
  }) | null | undefined;
@@ -275,6 +279,10 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
275
279
  input_tokens_details?: (Record<string, JSONValue | undefined> & {
276
280
  cached_tokens?: number | null | undefined;
277
281
  cache_write_tokens?: number | null | undefined;
282
+ cache_write_tokens_details?: (Record<string, JSONValue | undefined> & {
283
+ ttl_30m_tokens?: number | null | undefined;
284
+ ttl_12h_tokens?: number | null | undefined;
285
+ }) | null | undefined;
278
286
  orchestration_input_tokens?: number | null | undefined;
279
287
  orchestration_input_cached_tokens?: number | null | undefined;
280
288
  }) | null | undefined;
@@ -1105,7 +1113,8 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
1105
1113
  promptCacheKey?: string | null | undefined;
1106
1114
  promptCacheOptions?: {
1107
1115
  mode?: "explicit" | "implicit" | undefined;
1108
- ttl?: "30m" | undefined;
1116
+ ttl?: "30m" | "12h" | undefined;
1117
+ prewarm?: boolean | undefined;
1109
1118
  } | undefined;
1110
1119
  promptCacheRetention?: "in_memory" | "24h" | null | undefined;
1111
1120
  reasoningEffort?: string | null | undefined;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var import_provider_utils5 = require("@ai-sdk/provider-utils");
36
36
  // src/openai-error.ts
37
37
  var import_v4 = require("zod/v4");
38
38
  var import_provider_utils = require("@ai-sdk/provider-utils");
39
- var openaiErrorDataSchema = import_v4.z.object({
39
+ var openaiErrorDataSchema = () => import_v4.z.object({
40
40
  error: import_v4.z.object({
41
41
  message: import_v4.z.string(),
42
42
  // The additional information below is handled loosely to support
@@ -47,8 +47,11 @@ var openaiErrorDataSchema = import_v4.z.object({
47
47
  code: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).nullish()
48
48
  })
49
49
  });
50
+ var openaiErrorDataSchemaValidator = (0, import_provider_utils.lazySchema)(
51
+ () => (0, import_provider_utils.zodSchema)(openaiErrorDataSchema())
52
+ );
50
53
  var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
51
- errorSchema: openaiErrorDataSchema,
54
+ errorSchema: openaiErrorDataSchemaValidator,
52
55
  errorToMessage: (data) => data.error.message
53
56
  });
54
57
 
@@ -802,7 +805,7 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazySchema)(
802
805
  }).nullish()
803
806
  }).nullish()
804
807
  }),
805
- openaiErrorDataSchema
808
+ openaiErrorDataSchema()
806
809
  ])
807
810
  )
808
811
  );
@@ -1651,7 +1654,7 @@ var openaiCompletionChunkSchema = (0, import_provider_utils6.lazySchema)(
1651
1654
  total_tokens: import_v44.z.number()
1652
1655
  }).nullish()
1653
1656
  }),
1654
- openaiErrorDataSchema
1657
+ openaiErrorDataSchema()
1655
1658
  ])
1656
1659
  )
1657
1660
  );
@@ -2109,7 +2112,7 @@ function getMaxImagesPerCall(modelId) {
2109
2112
  var _a2;
2110
2113
  return (_a2 = modelMaxImagesPerCall[modelId]) != null ? _a2 : modelId.startsWith("gpt-image-") ? 10 : 1;
2111
2114
  }
2112
- var baseImageModelOptionsObject = import_v49.z.object({
2115
+ var baseImageModelOptionsObject = () => import_v49.z.object({
2113
2116
  /**
2114
2117
  * Quality of the generated image(s).
2115
2118
  *
@@ -2140,11 +2143,11 @@ var baseImageModelOptionsObject = import_v49.z.object({
2140
2143
  user: import_v49.z.string().optional()
2141
2144
  });
2142
2145
  var openaiImageModelOptions = (0, import_provider_utils13.lazySchema)(
2143
- () => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject)
2146
+ () => (0, import_provider_utils13.zodSchema)(baseImageModelOptionsObject())
2144
2147
  );
2145
2148
  var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
2146
2149
  () => (0, import_provider_utils13.zodSchema)(
2147
- baseImageModelOptionsObject.extend({
2150
+ baseImageModelOptionsObject().extend({
2148
2151
  /**
2149
2152
  * Style of the generated image. `vivid` produces hyper-real and
2150
2153
  * dramatic images; `natural` produces more subdued, less hyper-real
@@ -2161,7 +2164,7 @@ var openaiImageModelGenerationOptions = (0, import_provider_utils13.lazySchema)(
2161
2164
  );
2162
2165
  var openaiImageModelEditOptions = (0, import_provider_utils13.lazySchema)(
2163
2166
  () => (0, import_provider_utils13.zodSchema)(
2164
- baseImageModelOptionsObject.extend({
2167
+ baseImageModelOptionsObject().extend({
2165
2168
  /**
2166
2169
  * Fidelity of the output image(s) to the input image(s).
2167
2170
  */
@@ -2501,15 +2504,16 @@ var customTool = (args) => customToolFactory(args);
2501
2504
  // src/tool/file-search.ts
2502
2505
  var import_provider_utils18 = require("@ai-sdk/provider-utils");
2503
2506
  var import_v413 = require("zod/v4");
2504
- var comparisonFilterSchema = import_v413.z.object({
2507
+ var comparisonFilterSchema = () => import_v413.z.object({
2505
2508
  key: import_v413.z.string(),
2506
2509
  type: import_v413.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2507
2510
  value: import_v413.z.union([import_v413.z.string(), import_v413.z.number(), import_v413.z.boolean(), import_v413.z.array(import_v413.z.string())])
2508
2511
  });
2509
- var compoundFilterSchema = import_v413.z.object({
2512
+ var cachedCompoundFilterSchema;
2513
+ var compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema = import_v413.z.object({
2510
2514
  type: import_v413.z.enum(["and", "or"]),
2511
2515
  filters: import_v413.z.array(
2512
- import_v413.z.union([comparisonFilterSchema, import_v413.z.lazy(() => compoundFilterSchema)])
2516
+ import_v413.z.union([comparisonFilterSchema(), import_v413.z.lazy(() => compoundFilterSchema())])
2513
2517
  )
2514
2518
  });
2515
2519
  var fileSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
@@ -2521,7 +2525,7 @@ var fileSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
2521
2525
  ranker: import_v413.z.string().optional(),
2522
2526
  scoreThreshold: import_v413.z.number().optional()
2523
2527
  }).optional(),
2524
- filters: import_v413.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2528
+ filters: import_v413.z.union([comparisonFilterSchema(), compoundFilterSchema()]).optional()
2525
2529
  })
2526
2530
  )
2527
2531
  );
@@ -2638,7 +2642,7 @@ var shellOutputSchema = (0, import_provider_utils21.lazySchema)(
2638
2642
  })
2639
2643
  )
2640
2644
  );
2641
- var shellSkillsSchema = import_v416.z.array(
2645
+ var shellSkillsSchema = () => import_v416.z.array(
2642
2646
  import_v416.z.discriminatedUnion("type", [
2643
2647
  import_v416.z.object({
2644
2648
  type: import_v416.z.literal("skillReference"),
@@ -2679,7 +2683,7 @@ var shellArgsSchema = (0, import_provider_utils21.lazySchema)(
2679
2683
  ).optional()
2680
2684
  })
2681
2685
  ]).optional(),
2682
- skills: shellSkillsSchema
2686
+ skills: shellSkillsSchema()
2683
2687
  }),
2684
2688
  import_v416.z.object({
2685
2689
  type: import_v416.z.literal("containerReference"),
@@ -2847,14 +2851,15 @@ var webSearchPreview = (0, import_provider_utils24.createProviderToolFactoryWith
2847
2851
  // src/tool/mcp.ts
2848
2852
  var import_provider_utils25 = require("@ai-sdk/provider-utils");
2849
2853
  var import_v420 = require("zod/v4");
2850
- var jsonValueSchema = import_v420.z.lazy(
2854
+ var cachedJsonValueSchema;
2855
+ var jsonValueSchema = () => cachedJsonValueSchema != null ? cachedJsonValueSchema : cachedJsonValueSchema = import_v420.z.lazy(
2851
2856
  () => import_v420.z.union([
2852
2857
  import_v420.z.string(),
2853
2858
  import_v420.z.number(),
2854
2859
  import_v420.z.boolean(),
2855
2860
  import_v420.z.null(),
2856
- import_v420.z.array(jsonValueSchema),
2857
- import_v420.z.record(import_v420.z.string(), jsonValueSchema)
2861
+ import_v420.z.array(jsonValueSchema()),
2862
+ import_v420.z.record(import_v420.z.string(), jsonValueSchema())
2858
2863
  ])
2859
2864
  );
2860
2865
  var mcpArgsSchema = (0, import_provider_utils25.lazySchema)(
@@ -2896,7 +2901,7 @@ var mcpOutputSchema = (0, import_provider_utils25.lazySchema)(
2896
2901
  name: import_v420.z.string(),
2897
2902
  arguments: import_v420.z.string(),
2898
2903
  output: import_v420.z.string().nullish(),
2899
- error: import_v420.z.union([import_v420.z.string(), jsonValueSchema]).optional()
2904
+ error: import_v420.z.union([import_v420.z.string(), jsonValueSchema()]).optional()
2900
2905
  })
2901
2906
  )
2902
2907
  );
@@ -3223,11 +3228,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils26.lazy
3223
3228
  /**
3224
3229
  * Prompt cache behavior for GPT-5.6 and later models.
3225
3230
  * `mode` controls whether OpenAI also places an implicit breakpoint.
3226
- * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
3231
+ * `ttl` sets the minimum cache lifetime: `'30m'` (default) or `'12h'`.
3232
+ * `prewarm` writes the prompt to the cache without generating output.
3227
3233
  */
3228
3234
  promptCacheOptions: import_v421.z.object({
3229
3235
  mode: import_v421.z.enum(["implicit", "explicit"]).optional(),
3230
- ttl: import_v421.z.literal("30m").optional()
3236
+ ttl: import_v421.z.enum(["30m", "12h"]).optional(),
3237
+ prewarm: import_v421.z.boolean().optional()
3231
3238
  }).optional(),
3232
3239
  /**
3233
3240
  * The retention policy for the prompt cache.
@@ -4487,10 +4494,14 @@ ${text}`,
4487
4494
  }
4488
4495
  return { input, warnings };
4489
4496
  }
4490
- var openaiResponsesReasoningProviderOptionsSchema = import_v422.z.object({
4491
- itemId: import_v422.z.string().nullish(),
4492
- reasoningEncryptedContent: import_v422.z.string().nullish()
4493
- });
4497
+ var openaiResponsesReasoningProviderOptionsSchema = (0, import_provider_utils28.lazySchema)(
4498
+ () => (0, import_provider_utils28.zodSchema)(
4499
+ import_v422.z.object({
4500
+ itemId: import_v422.z.string().nullish(),
4501
+ reasoningEncryptedContent: import_v422.z.string().nullish()
4502
+ })
4503
+ )
4504
+ );
4494
4505
 
4495
4506
  // src/responses/map-openai-responses-finish-reason.ts
4496
4507
  function mapOpenAIResponseFinishReason({
@@ -4513,33 +4524,41 @@ function mapOpenAIResponseFinishReason({
4513
4524
  // src/responses/openai-responses-api.ts
4514
4525
  var import_provider_utils29 = require("@ai-sdk/provider-utils");
4515
4526
  var import_v423 = require("zod/v4");
4516
- var jsonValueSchema2 = import_v423.z.lazy(
4527
+ var cachedJsonValueSchema2;
4528
+ var jsonValueSchema2 = () => cachedJsonValueSchema2 != null ? cachedJsonValueSchema2 : cachedJsonValueSchema2 = import_v423.z.lazy(
4517
4529
  () => import_v423.z.union([
4518
4530
  import_v423.z.string(),
4519
4531
  import_v423.z.number(),
4520
4532
  import_v423.z.boolean(),
4521
4533
  import_v423.z.null(),
4522
- import_v423.z.array(jsonValueSchema2),
4523
- import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional())
4534
+ import_v423.z.array(jsonValueSchema2()),
4535
+ import_v423.z.record(import_v423.z.string(), jsonValueSchema2().optional())
4524
4536
  ])
4525
4537
  );
4526
- var jsonObjectSchema = import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional());
4527
- var openaiResponsesUsageSchema = import_v423.z.intersection(
4528
- jsonObjectSchema,
4538
+ var jsonObjectSchema = () => import_v423.z.record(import_v423.z.string(), jsonValueSchema2().optional());
4539
+ var openaiResponsesUsageSchema = () => import_v423.z.intersection(
4540
+ jsonObjectSchema(),
4529
4541
  import_v423.z.object({
4530
4542
  input_tokens: import_v423.z.number(),
4531
4543
  input_tokens_details: import_v423.z.intersection(
4532
- jsonObjectSchema,
4544
+ jsonObjectSchema(),
4533
4545
  import_v423.z.object({
4534
4546
  cached_tokens: import_v423.z.number().nullish(),
4535
4547
  cache_write_tokens: import_v423.z.number().nullish(),
4548
+ cache_write_tokens_details: import_v423.z.intersection(
4549
+ jsonObjectSchema(),
4550
+ import_v423.z.object({
4551
+ ttl_30m_tokens: import_v423.z.number().nullish(),
4552
+ ttl_12h_tokens: import_v423.z.number().nullish()
4553
+ })
4554
+ ).nullish(),
4536
4555
  orchestration_input_tokens: import_v423.z.number().nullish(),
4537
4556
  orchestration_input_cached_tokens: import_v423.z.number().nullish()
4538
4557
  })
4539
4558
  ).nullish(),
4540
4559
  output_tokens: import_v423.z.number(),
4541
4560
  output_tokens_details: import_v423.z.intersection(
4542
- jsonObjectSchema,
4561
+ jsonObjectSchema(),
4543
4562
  import_v423.z.object({
4544
4563
  reasoning_tokens: import_v423.z.number().nullish(),
4545
4564
  orchestration_output_tokens: import_v423.z.number().nullish()
@@ -4551,7 +4570,7 @@ var openaiResponsesUsageSchema = import_v423.z.intersection(
4551
4570
  function isRecord(value) {
4552
4571
  return value != null && typeof value === "object" && !Array.isArray(value);
4553
4572
  }
4554
- var openaiResponsesLocalShellCallSchema = import_v423.z.object({
4573
+ var openaiResponsesLocalShellCallSchema = () => import_v423.z.object({
4555
4574
  type: import_v423.z.literal("local_shell_call"),
4556
4575
  id: import_v423.z.string(),
4557
4576
  call_id: import_v423.z.string(),
@@ -4564,7 +4583,7 @@ var openaiResponsesLocalShellCallSchema = import_v423.z.object({
4564
4583
  env: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).optional()
4565
4584
  })
4566
4585
  });
4567
- var openaiResponsesNestedErrorChunkSchema = import_v423.z.object({
4586
+ var openaiResponsesNestedErrorChunkSchema = () => import_v423.z.object({
4568
4587
  type: import_v423.z.literal("error"),
4569
4588
  sequence_number: import_v423.z.number(),
4570
4589
  error: import_v423.z.object({
@@ -4574,7 +4593,7 @@ var openaiResponsesNestedErrorChunkSchema = import_v423.z.object({
4574
4593
  param: import_v423.z.string().nullish()
4575
4594
  })
4576
4595
  });
4577
- var openaiResponsesErrorChunkSchema = import_v423.z.object({
4596
+ var openaiResponsesErrorChunkSchema = () => import_v423.z.object({
4578
4597
  type: import_v423.z.literal("error"),
4579
4598
  sequence_number: import_v423.z.number(),
4580
4599
  code: import_v423.z.string().nullish(),
@@ -4659,7 +4678,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
4659
4678
  type: import_v423.z.enum(["response.completed", "response.incomplete"]),
4660
4679
  response: import_v423.z.object({
4661
4680
  incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
4662
- usage: openaiResponsesUsageSchema.nullish(),
4681
+ usage: openaiResponsesUsageSchema().nullish(),
4663
4682
  reasoning: import_v423.z.object({
4664
4683
  context: import_v423.z.string().nullish()
4665
4684
  }).nullish(),
@@ -4675,7 +4694,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
4675
4694
  message: import_v423.z.string()
4676
4695
  }).nullish(),
4677
4696
  incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
4678
- usage: openaiResponsesUsageSchema.nullish(),
4697
+ usage: openaiResponsesUsageSchema().nullish(),
4679
4698
  reasoning: import_v423.z.object({
4680
4699
  context: import_v423.z.string().nullish()
4681
4700
  }).nullish(),
@@ -4728,7 +4747,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
4728
4747
  type: import_v423.z.literal("file_search_call"),
4729
4748
  id: import_v423.z.string()
4730
4749
  }),
4731
- openaiResponsesLocalShellCallSchema,
4750
+ openaiResponsesLocalShellCallSchema(),
4732
4751
  import_v423.z.object({
4733
4752
  type: import_v423.z.literal("image_generation_call"),
4734
4753
  id: import_v423.z.string()
@@ -4832,7 +4851,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
4832
4851
  execution: import_v423.z.enum(["server", "client"]),
4833
4852
  call_id: import_v423.z.string().nullable(),
4834
4853
  status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
4835
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
4854
+ tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2().optional()))
4836
4855
  })
4837
4856
  ])
4838
4857
  }),
@@ -4930,7 +4949,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
4930
4949
  })
4931
4950
  ).nullish()
4932
4951
  }),
4933
- openaiResponsesLocalShellCallSchema,
4952
+ openaiResponsesLocalShellCallSchema(),
4934
4953
  import_v423.z.object({
4935
4954
  type: import_v423.z.literal("computer_call"),
4936
4955
  id: import_v423.z.string(),
@@ -5047,7 +5066,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
5047
5066
  execution: import_v423.z.enum(["server", "client"]),
5048
5067
  call_id: import_v423.z.string().nullable(),
5049
5068
  status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
5050
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
5069
+ tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2().optional()))
5051
5070
  })
5052
5071
  ])
5053
5072
  }),
@@ -5149,8 +5168,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
5149
5168
  output_index: import_v423.z.number(),
5150
5169
  diff: import_v423.z.string()
5151
5170
  }),
5152
- openaiResponsesNestedErrorChunkSchema,
5153
- openaiResponsesErrorChunkSchema,
5171
+ openaiResponsesNestedErrorChunkSchema(),
5172
+ openaiResponsesErrorChunkSchema(),
5154
5173
  import_v423.z.object({ type: import_v423.z.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
5155
5174
  message: "Known response chunk failed schema validation"
5156
5175
  }).transform((value) => ({
@@ -5293,7 +5312,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils29.lazySchema)(
5293
5312
  id: import_v423.z.string(),
5294
5313
  result: import_v423.z.string()
5295
5314
  }),
5296
- openaiResponsesLocalShellCallSchema,
5315
+ openaiResponsesLocalShellCallSchema(),
5297
5316
  import_v423.z.object({
5298
5317
  type: import_v423.z.literal("function_call"),
5299
5318
  call_id: import_v423.z.string(),
@@ -5438,7 +5457,9 @@ var openaiResponsesResponseSchema = (0, import_provider_utils29.lazySchema)(
5438
5457
  execution: import_v423.z.enum(["server", "client"]),
5439
5458
  call_id: import_v423.z.string().nullable(),
5440
5459
  status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
5441
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
5460
+ tools: import_v423.z.array(
5461
+ import_v423.z.record(import_v423.z.string(), jsonValueSchema2().optional())
5462
+ )
5442
5463
  })
5443
5464
  ])
5444
5465
  ).optional(),
@@ -5447,7 +5468,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils29.lazySchema)(
5447
5468
  context: import_v423.z.string().nullish()
5448
5469
  }).nullish(),
5449
5470
  incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
5450
- usage: openaiResponsesUsageSchema.nullish()
5471
+ usage: openaiResponsesUsageSchema().nullish()
5451
5472
  })
5452
5473
  )
5453
5474
  );
@@ -8304,7 +8325,7 @@ var OpenAITranscriptionModel = class {
8304
8325
  };
8305
8326
 
8306
8327
  // src/version.ts
8307
- var VERSION = true ? "3.0.129" : "0.0.0-test";
8328
+ var VERSION = true ? "3.0.131" : "0.0.0-test";
8308
8329
 
8309
8330
  // src/openai-provider.ts
8310
8331
  function createOpenAI(options = {}) {