> 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.

Enables context window compression to manage the model's context window.

This mechanism prevents the context from exceeding a given length.

**Signature:**

    export interface ContextWindowCompressionConfig 

## Properties

| Property | Type | Description |
|---|---|---|
| [slidingWindow](https://firebase.google.com/docs/reference/js/ai.contextwindowcompressionconfig#contextwindowcompressionconfigslidingwindow) | [SlidingWindow](https://firebase.google.com/docs/reference/js/ai.slidingwindow#slidingwindow_interface) | ***(Public Preview)*** The sliding window compression mechanism. |
| [triggerTokens](https://firebase.google.com/docs/reference/js/ai.contextwindowcompressionconfig#contextwindowcompressionconfigtriggertokens) | number | ***(Public Preview)*** The number of tokens (before running a turn) that triggers the context window compression. |

## ContextWindowCompressionConfig.slidingWindow

> 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 sliding window compression mechanism.

**Signature:**

    slidingWindow?: SlidingWindow;

## ContextWindowCompressionConfig.triggerTokens

> 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 number of tokens (before running a turn) that triggers the context window compression.

**Signature:**

    triggerTokens?: number;