Interface: PromptCacheOptions
Defined in: packages/core/src/prompt-cache.ts:45
Explicit prompt-cache plan. Object form defaults to prefix-only so a stable tools+system prefix can be stamped without writing unique turns.
Examples
Prefix-only — stable tools + system, unique suffix uncached
await bot.process(input, { cache: { scope: 'prefix', ttl: '1h' } });
Chat-style, same as `enableCaching: true` / `cacheControl: true`
await bot.process(input, { cache: { scope: 'chat' } });
Properties
lastMessages?
optionallastMessages?:number
Defined in: packages/core/src/prompt-cache.ts:61
How many trailing conversation messages to stamp. 0 = none.
scope?
optionalscope?:PromptCacheScope
Defined in: packages/core/src/prompt-cache.ts:52
Convenience: 'prefix' → last-tool + system, no messages;
'chat' → last-tool + system + last 4.
Ignored for a field the caller set explicitly (system, tools,
lastMessages).
system?
optionalsystem?:boolean
Defined in: packages/core/src/prompt-cache.ts:59
Stamp the system / instructions block. Default true.
tools?
optionaltools?:boolean
Defined in: packages/core/src/prompt-cache.ts:57
Stamp the last always-loaded tool (skip deferred / provider tools).
Skipped when a tool already carries a stamp. Default true.
ttl?
optionalttl?:AnthropicCacheTtl
Defined in: packages/core/src/prompt-cache.ts:63
Forwarded on every stamp this plan writes, and onto existing stamps that omit it.