Skip to content

CachePointBlock

Defined in: src/types/messages.ts:556

Cache point block for prompt caching. Marks a position in a message or system prompt where caching should occur.

new CachePointBlock(data): CachePointBlock;

Defined in: src/types/messages.ts:573

| Parameter | Type | | --------- | ------------------------------------------------ | | data | CachePointBlockData |

CachePointBlock

readonly type: "cachePointBlock";

Defined in: src/types/messages.ts:560

Discriminator for cache point.


readonly cacheType: "default";

Defined in: src/types/messages.ts:565

The cache type. Currently only ‘default’ is supported.

CachePointBlockData.cacheType


readonly optional ttl?: string;

Defined in: src/types/messages.ts:571

Optional TTL for the cache entry. See CachePointBlockData.ttl for the provider-specific value space.

CachePointBlockData.ttl

toJSON(): {
cachePoint: CachePointBlockData;
};

Defined in: src/types/messages.ts:584

Serializes the CachePointBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify().

{
cachePoint: CachePointBlockData;
}

| Name | Type | Defined in | | ------------ | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | cachePoint | CachePointBlockData | src/types/messages.ts:584 |

JSONSerializable.toJSON

static fromJSON(data): CachePointBlock;

Defined in: src/types/messages.ts:599

Creates a CachePointBlock instance from its wrapped data format.

| Parameter | Type | Description | | ----------------- | -------------------------------------------------------------------- | ------------------------------------------ | | data | { cachePoint: CachePointBlockData; } | Wrapped CachePointBlockData to deserialize | | data.cachePoint | CachePointBlockData | - |

CachePointBlock

CachePointBlock instance