Skip to main content

CompactionConfig

Configuration for compaction strategy

Usage profiles​

UsageFields and validation
In requestsView fields
In responsesView fields

In requests​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
modestring (COMPACTION_MODE_SYNC, COMPACTION_MODE_ASYNC) or integer (int32)OptionalContext compaction mode selected by the operation.
thresholdThresholdConfigOptionalToken-count or context-window-percentage threshold that triggers compaction.
generationConfigGenerationConfigOptionalSeparate config for compaction LLM calls.
preserveRecentinteger (int32)OptionalMessages to keep uncompacted. Minimum: -2147483648. Maximum: 2147483647.

Values of mode​

Whether context compaction blocks the triggering operation or proceeds asynchronously.

ValueNo.FormMeaning
COMPACTION_MODE_SYNC1CanonicalWait for compaction to finish before continuing the dependent operation.
COMPACTION_MODE_ASYNC2CanonicalStart compaction asynchronously and apply its result when it becomes available.

In responses​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
modestring (COMPACTION_MODE_SYNC, COMPACTION_MODE_ASYNC) or integer (int32)OptionalContext compaction mode selected by the operation.
thresholdThresholdConfigOptionalToken-count or context-window-percentage threshold that triggers compaction.
generationConfigGenerationConfigOptionalSeparate config for compaction LLM calls.
preserveRecentinteger (int32)OptionalMessages to keep uncompacted. Minimum: -2147483648. Maximum: 2147483647.

Values of mode​

Whether context compaction blocks the triggering operation or proceeds asynchronously.

ValueNo.FormMeaning
COMPACTION_MODE_SYNC1CanonicalWait for compaction to finish before continuing the dependent operation.
COMPACTION_MODE_ASYNC2CanonicalStart compaction asynchronously and apply its result when it becomes available.

Where used​

ReferenceRelationship
Create a new conversation threadPOST /api/v1/llm/create-thread
Update context management settingsPOST /api/v1/llm/update-context-management-settings
Get full conversation statePOST /api/v1/llm/conversation-state
ContextManagementSettingsNested in model
ContextManagementSettingsNested in model

Download the public reference contract.

Document: DOC-API-MODEL-compaction-config.