Skip to main content
Section ID: DOC-API-MODEL-schema-1fpqunnq41#overview

Compaction

Compaction metadata

Meaning and usage​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#meaning

See the definition above.

Usage profiles​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#fields

UsageFields and validation
In responsesView fields

In responses​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#response

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-idSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-ididstringOptionalIdentifier of the compaction record.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-startsequenceSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-startsequencestartSequencestring (int64)OptionalSequence number of the first conversation message represented by the compaction. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-endsequenceSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-endsequenceendSequencestring (int64)OptionalSequence number of the last conversation message represented by the compaction. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-summarySection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-summarysummarystringOptionalSummary text produced by conversation compaction.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-originaltokencountSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-originaltokencountoriginalTokenCountstring (int64)OptionalEstimated token count of the context before compaction. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-summarytokencountSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-summarytokencountsummaryTokenCountstring (int64)OptionalEstimated token count of the generated summary. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-modelusedSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-modelusedmodelUsedstringOptionalModel identifier used for the context compaction.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-createdatSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-createdatcreatedAtstring (date-time)OptionalTime when this record was created.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-statusSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-statusstatusstring (COMPACTION_STATUS_PENDING, COMPACTION_STATUS_COMPLETED, COMPACTION_STATUS_FAILED) or integer (int32)Optional; explicit presenceExecution state of the conversation compaction.
Section ID: DOC-API-MODEL-schema-1fpqunnq41#field-triggerreasonSection ID: DOC-API-MODEL-schema-1fpqunnq41#response-field-triggerreasontriggerReasonstring (COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED, COMPACTION_TRIGGER_REASON_MANUAL) or integer (int32)Optional; explicit presenceReason for triggering this compaction (auto threshold vs manual)

Values of status​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#response-values-status

Execution state of a conversation context-compaction attempt.

ValueNo.FormMeaning
COMPACTION_STATUS_PENDING0CanonicalCompaction was started and its result is still pending.
COMPACTION_STATUS_COMPLETED1CanonicalCompaction completed and produced its result.
COMPACTION_STATUS_FAILED2CanonicalCompaction failed; inspect the associated error.

Values of triggerReason​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#response-values-triggerreason

Compaction Events

Reason a conversation context-compaction attempt was started.

ValueNo.FormMeaning
COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED0CanonicalContext usage crossed the configured compaction threshold.
COMPACTION_TRIGGER_REASON_MANUAL1CanonicalA caller explicitly requested compaction.

Where used​

Section ID: DOC-API-MODEL-schema-1fpqunnq41#where-used

ReferenceRelationship
Get full conversation statePOST /api/v1/llm/conversation-state

Download the public reference contract.

Document ID: DOC-API-MODEL-schema-1fpqunnq41