Table of Contents

Class SlidingWindow

Namespace
GenerativeAI.Types
Assembly
GenerativeAI.dll

Context window will be truncated by keeping only suffix of it. Context window will always be cut at start of USER role turn. System instructions and LiveClientSetup.prefix_turns will not be subject to the sliding window mechanism, they will always stay at the beginning of context window.

public class SlidingWindow
Inheritance
SlidingWindow
Inherited Members
Extension Methods

Properties

TargetTokens

Session reduction target -- how many tokens we should keep. Window shortening operation has some latency costs, so we should avoid running it on every turn. Should be < trigger_tokens. If not set, trigger_tokens/2 is assumed.

[JsonPropertyName("targetTokens")]
public int? TargetTokens { get; set; }

Property Value

int?