SlidingWindow interface

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Configures the sliding window context compression mechanism.

The sliding window discards content at the beginning of the context window. The resulting context will always begin at the start of a user role turn. System instructions will always remain at the start of the result.

Signature:

export interface SlidingWindow 

Properties

Property Type Description
targetTokens number (Public Preview) The session reduction target, for example, how many tokens the model should keep.

SlidingWindow.targetTokens

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The session reduction target, for example, how many tokens the model should keep.

Signature:

targetTokens?: number;