/** * BedrockCacheStrategy — REGISTERED, AND HONEST ABOUT DOING NOTHING (9.59.0). * * What Bedrock supports and what THIS ADAPTER does are two different facts, * and until 9.59.0 the strategy stated the first while the runtime lived * under the second: * * - AWS's Converse API does support prompt caching for Claude models * (`cachePoint: { type: 'default' }` entries inserted into the `system` / * `tools` / `messages` arrays) and does report * `cacheReadInputTokens` / `cacheWriteInputTokens` in its usage block. * - `BedrockProvider` implements NEITHER half. It never reads * `req.cacheMarkers` (compare `AnthropicProvider`, which calls * `applyCacheMarkers`) and it builds `usage` as `{ input, output }` at * both its streaming and non-streaming sites. The string "cache" does * not appear in that file. * * So this strategy used to clamp markers onto a request field the adapter * then discarded, and report `markersApplied` for markers that never reached * a wire — a meter attached to a provider that cannot feed it. It now: * * - declares `enabled: false` (nothing here works end to end); * - passes the request through with `markersApplied: []`, and says why * once, in dev mode; * - answers `extractMetrics` with `not-applicable` and the reason. * * It stays REGISTERED rather than being deleted so that a Bedrock consumer * asking the registry what it got is told the truth by name, instead of * silently falling through to the wildcard NoOp and being left to guess. * * Note on Converse: the send half is genuinely a DIFFERENT wire from * Anthropic's `cache_control` block, so implementing it wants its own * `bedrockCacheWire.ts` beside `anthropicCacheWire.ts` — not a reuse. That * is the follow-up this file is waiting for; when it lands, flip `enabled` * and give `extractMetrics` the `readPortCacheUsage` body the Anthropic * strategy has. * * Auto-registers under provider name `'bedrock'`. */ import type { CacheCapabilities, CacheMarker, CacheMetrics, CacheStrategy, CacheStrategyContext, CacheUsage } from '../types.js'; import { type Claim } from '../../lib/claim/claim.js'; import type { LLMRequest } from '../../adapters/types.js'; export declare class BedrockCacheStrategy implements CacheStrategy { readonly providerName = "bedrock"; readonly capabilities: CacheCapabilities; prepareRequest(req: LLMRequest, candidates: readonly CacheMarker[], _ctx: CacheStrategyContext): Promise<{ readonly request: LLMRequest; readonly markersApplied: readonly CacheMarker[]; }>; /** * Always `not-applicable` — and that is a statement about THIS adapter, * not about Bedrock. AWS's Converse API does report * `cacheReadInputTokens` / `cacheWriteInputTokens`, but * `BedrockProvider` never reads them: its `usage` is built as * `{ input, output }` at both the streaming and non-streaming sites. So * `cacheRead`/`cacheWrite` are ALWAYS absent on this port, and an * `unknown` per call would read as a measurement that merely failed. * `not-applicable` says the true thing: nothing here can be measured * until the adapter grows the read half. */ extractMetrics(_usage: CacheUsage | undefined): Claim; } //# sourceMappingURL=BedrockCacheStrategy.d.ts.map