CachePointBlock
Defined in: src/types/messages.ts:499
Cache point block for prompt caching. Marks a position in a message or system prompt where caching should occur.
Implements
Section titled “Implements”CachePointBlockDataJSONSerializable<{cachePoint:CachePointBlockData; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CachePointBlock(data): CachePointBlock;Defined in: src/types/messages.ts:510
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | CachePointBlockData |
Returns
Section titled “Returns”CachePointBlock
Properties
Section titled “Properties”readonly type: "cachePointBlock";Defined in: src/types/messages.ts:503
Discriminator for cache point.
cacheType
Section titled “cacheType”readonly cacheType: "default";Defined in: src/types/messages.ts:508
The cache type. Currently only ‘default’ is supported.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): { cachePoint: CachePointBlockData;};Defined in: src/types/messages.ts:518
Serializes the CachePointBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify().
Returns
Section titled “Returns”{ cachePoint: CachePointBlockData;}| Name | Type | Defined in |
|---|---|---|
cachePoint | CachePointBlockData | src/types/messages.ts:518 |
Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”static fromJSON(data): CachePointBlock;Defined in: src/types/messages.ts:532
Creates a CachePointBlock instance from its wrapped data format.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | { cachePoint: CachePointBlockData; } | Wrapped CachePointBlockData to deserialize |
data.cachePoint | CachePointBlockData | - |
Returns
Section titled “Returns”CachePointBlock
CachePointBlock instance