CompactionConfig
Configuration for compaction strategy
Usage profiles
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
In requests
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
mode | string (COMPACTION_MODE_SYNC, COMPACTION_MODE_ASYNC) or integer (int32) | Optional | Context compaction mode selected by the operation. |
threshold | ThresholdConfig | Optional | Token-count or context-window-percentage threshold that triggers compaction. |
generationConfig | GenerationConfig | Optional | Separate config for compaction LLM calls. |
preserveRecent | integer (int32) | Optional | Messages to keep uncompacted. Minimum: -2147483648. Maximum: 2147483647. |
Values of mode
Whether context compaction blocks the triggering operation or proceeds asynchronously.
| Value | No. | Form | Meaning |
|---|---|---|---|
COMPACTION_MODE_SYNC | 1 | Canonical | Wait for compaction to finish before continuing the dependent operation. |
COMPACTION_MODE_ASYNC | 2 | Canonical | Start compaction asynchronously and apply its result when it becomes available. |
In responses
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
mode | string (COMPACTION_MODE_SYNC, COMPACTION_MODE_ASYNC) or integer (int32) | Optional | Context compaction mode selected by the operation. |
threshold | ThresholdConfig | Optional | Token-count or context-window-percentage threshold that triggers compaction. |
generationConfig | GenerationConfig | Optional | Separate config for compaction LLM calls. |
preserveRecent | integer (int32) | Optional | Messages to keep uncompacted. Minimum: -2147483648. Maximum: 2147483647. |
Values of mode
Whether context compaction blocks the triggering operation or proceeds asynchronously.
| Value | No. | Form | Meaning |
|---|---|---|---|
COMPACTION_MODE_SYNC | 1 | Canonical | Wait for compaction to finish before continuing the dependent operation. |
COMPACTION_MODE_ASYNC | 2 | Canonical | Start compaction asynchronously and apply its result when it becomes available. |
Where used
| Reference | Relationship |
|---|---|
| Create a new conversation thread | POST /api/v1/llm/create-thread |
| Update context management settings | POST /api/v1/llm/update-context-management-settings |
| Get full conversation state | POST /api/v1/llm/conversation-state |
| ContextManagementSettings | Nested in model |
| ContextManagementSettings | Nested in model |
Download the public reference contract.
Document: DOC-API-MODEL-compaction-config.