@ai-sdk/openai 2.0.66 → 2.0.67

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.
@@ -18,6 +18,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
18
18
  strictJsonSchema?: boolean | undefined;
19
19
  textVerbosity?: "low" | "medium" | "high" | undefined;
20
20
  promptCacheKey?: string | undefined;
21
+ promptCacheRetention?: "in_memory" | "24h" | undefined;
21
22
  safetyIdentifier?: string | undefined;
22
23
  }>;
23
24
  type OpenAIChatLanguageModelOptions = InferValidator<typeof openaiChatLanguageModelOptions>;
@@ -18,6 +18,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
18
18
  strictJsonSchema?: boolean | undefined;
19
19
  textVerbosity?: "low" | "medium" | "high" | undefined;
20
20
  promptCacheKey?: string | undefined;
21
+ promptCacheRetention?: "in_memory" | "24h" | undefined;
21
22
  safetyIdentifier?: string | undefined;
22
23
  }>;
23
24
  type OpenAIChatLanguageModelOptions = InferValidator<typeof openaiChatLanguageModelOptions>;
@@ -502,6 +502,15 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
502
502
  * Useful for improving cache hit rates and working around automatic caching issues.
503
503
  */
504
504
  promptCacheKey: import_v43.z.string().optional(),
505
+ /**
506
+ * The retention policy for the prompt cache.
507
+ * - 'in_memory': Default. Standard prompt caching behavior.
508
+ * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
509
+ * Currently only available for 5.1 series models.
510
+ *
511
+ * @default 'in_memory'
512
+ */
513
+ promptCacheRetention: import_v43.z.enum(["in_memory", "24h"]).optional(),
505
514
  /**
506
515
  * A stable identifier used to help detect users of your application
507
516
  * that may be violating OpenAI's usage policies. The IDs should be a
@@ -668,6 +677,7 @@ var OpenAIChatLanguageModel = class {
668
677
  reasoning_effort: openaiOptions.reasoningEffort,
669
678
  service_tier: openaiOptions.serviceTier,
670
679
  prompt_cache_key: openaiOptions.promptCacheKey,
680
+ prompt_cache_retention: openaiOptions.promptCacheRetention,
671
681
  safety_identifier: openaiOptions.safetyIdentifier,
672
682
  // messages:
673
683
  messages
@@ -2987,6 +2997,15 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValid
2987
2997
  parallelToolCalls: import_v415.z.boolean().nullish(),
2988
2998
  previousResponseId: import_v415.z.string().nullish(),
2989
2999
  promptCacheKey: import_v415.z.string().nullish(),
3000
+ /**
3001
+ * The retention policy for the prompt cache.
3002
+ * - 'in_memory': Default. Standard prompt caching behavior.
3003
+ * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
3004
+ * Currently only available for 5.1 series models.
3005
+ *
3006
+ * @default 'in_memory'
3007
+ */
3008
+ promptCacheRetention: import_v415.z.enum(["in_memory", "24h"]).nullish(),
2990
3009
  reasoningEffort: import_v415.z.string().nullish(),
2991
3010
  reasoningSummary: import_v415.z.string().nullish(),
2992
3011
  safetyIdentifier: import_v415.z.string().nullish(),
@@ -3504,6 +3523,7 @@ var OpenAIResponsesLanguageModel = class {
3504
3523
  service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,
3505
3524
  include,
3506
3525
  prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,
3526
+ prompt_cache_retention: openaiOptions == null ? void 0 : openaiOptions.promptCacheRetention,
3507
3527
  safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,
3508
3528
  top_logprobs: topLogprobs,
3509
3529
  truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,