import type { Message, ModelConfig, ProviderRequest, ProviderRequestOptions } from "@arnilo/prism"; /** OpenAI Responses `prompt_cache_key` accepted length cap. */ export declare const OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH = 64; export declare function promptCacheKey(options: ProviderRequestOptions | undefined): string | undefined; /** * OpenAI Responses only accepts `prompt_cache_retention: "24h"` (extended * caching). Default short caching is automatic and implicit, so `"short"` and * `"none"` omit the field rather than emitting an invalid literal. `"long"` * maps to `"24h"` only when the model declares `cache.longRetention`; unknown * models omit the field so Prism never sends unsupported retention values. */ export declare function promptCacheRetention(options: ProviderRequestOptions | undefined, model: ModelConfig): "24h" | undefined; /** * GPT-5.6+ explicit-only caching: `prompt_cache_options: { mode: "explicit" }`. * Activated when the model declares `cache.explicitBreakpoints` and the host * supplies `cache.breakpoints` (or forces `cache.mode: "on"`). The only TTL is * `"30m"` (also the default), so no ttl field is ever emitted. Older models and * `cache.mode: "off"` keep implicit caching with no options field. * @see https://developers.openai.com/api/docs/guides/prompt-caching */ export declare function promptCacheOptions(options: ProviderRequestOptions | undefined, model: ModelConfig): { mode: "explicit"; } | undefined; export type OpenAIBreakpointMessage = Omit & { readonly content: readonly (Message["content"][number] & { readonly prompt_cache_breakpoint?: { readonly mode: "explicit"; }; })[]; }; /** * Stamp `prompt_cache_breakpoint: { mode: "explicit" }` on the last content * block of caller-selected `cache.breakpoints` anchors (shared selection * semantics with `applyCacheControl`). Only runs when `promptCacheOptions` * activates explicit mode; `tools` breakpoints are skipped (tool definitions * are not markable content blocks in Responses). */ export declare function applyPromptCacheBreakpoints(request: ProviderRequest): readonly OpenAIBreakpointMessage[];