Compaction
Compaction metadata
Usage profiles
| Usage | Fields and validation |
|---|---|
| In responses | View fields |
In responses
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
id | string | Optional | Identifier of the compaction record. |
startSequence | string (int64) | Optional | Sequence number of the first conversation message represented by the compaction. Pattern: ^-?\d+$. |
endSequence | string (int64) | Optional | Sequence number of the last conversation message represented by the compaction. Pattern: ^-?\d+$. |
summary | string | Optional | Summary text produced by conversation compaction. |
originalTokenCount | integer (int32) | Optional | Estimated token count of the context before compaction. Minimum: -2147483648. Maximum: 2147483647. |
summaryTokenCount | integer (int32) | Optional | Estimated token count of the generated summary. Minimum: -2147483648. Maximum: 2147483647. |
modelUsed | string | Optional | Model identifier used for the context compaction. |
createdAt | string (date-time) | Optional | Time when this record was created. |
status | string (COMPACTION_STATUS_PENDING, COMPACTION_STATUS_COMPLETED, COMPACTION_STATUS_FAILED) or integer (int32) | Optional | Execution state of the conversation compaction. |
triggerReason | string (COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED, COMPACTION_TRIGGER_REASON_MANUAL) or integer (int32) | Optional | Reason for triggering this compaction (auto threshold vs manual) |
Values of status
Execution state of a conversation context-compaction attempt.
| Value | No. | Form | Meaning |
|---|---|---|---|
COMPACTION_STATUS_PENDING | 1 | Canonical | Compaction was started and its result is still pending. |
COMPACTION_STATUS_COMPLETED | 2 | Canonical | Compaction completed and produced its result. |
COMPACTION_STATUS_FAILED | 3 | Canonical | Compaction failed; inspect the associated error. |
Values of triggerReason
Reason a conversation context-compaction attempt was started.
| Value | No. | Form | Meaning |
|---|---|---|---|
COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED | 1 | Canonical | Context usage crossed the configured compaction threshold. |
COMPACTION_TRIGGER_REASON_MANUAL | 2 | Canonical | A caller explicitly requested compaction. |
Where used
| Reference | Relationship |
|---|---|
| Get full conversation state | POST /api/v1/llm/conversation-state |
Download the public reference contract.
Document: DOC-API-MODEL-compaction.