Skip to content

InteractionContextSettings

How an interaction keeps its conversation within the model’s context window, and how many rounds of tool calls an agent may make in one turn.

Kind: an object, used in requests and responses. In a request it is called InteractionContextSettingsInput.

FieldTypeRequiredDescription
modeContextTrimmingModeWhat happens when the conversation no longer fits the model’s context window.
targetUtilizationnumberHow full the context window may get, as a fraction from 0 to 1, before the conversation is shortened.
toolResultTrimmingModeToolResultTrimmingModeWhen the results of earlier tool calls are replaced, to save space.
toolResultTrimmingMaxCyclesinteger | nullWith toolResultTrimmingMode set to AfterCycles or Both: once an agent has had this many turns, every tool result but the latest is replaced.
toolResultTrimmingStyleToolResultTrimmingStyle| nullWhat a replaced tool result becomes. Null: Placeholder.
toolResultTrimmingReplacementstringThe text a replaced tool result becomes, with the Placeholder style.
compactionTypeCompactionType| nullWhether, and how, older parts of a long conversation are summarised to make room. Suits long, many-turn conversations such as chats. Null: no summaries (None).
lowWaterUtilizationnumber | nullWith compaction on: how far a forced trim shortens the conversation, as a fraction of the context window from 0 to 1, so that it is not trimmed again on the very next turn. Null: 0.2. Never more than targetUtilization.
compactAtUtilizationnumberHow full the context window gets, as a fraction from 0 to 1, before the conversation is summarised (0.85 is 85% full).
compactKeepRecentTokensintegerThe most recent part of the conversation kept word for word when it is summarised, in tokens.
compactTargetTokensintegerThe length the summary aims for, in tokens. compactMaxTokens is the hard limit.
maxToolCallLoopsinteger | nullThe most rounds of tool calls an agent may make in one turn. After that its tools are withheld and it is told to answer. 0 means no limit; null means 10.
responseMaxTokensinteger | nullThe most the model may write in one reply, in tokens, including any reasoning; that much of the context window is kept free for the reply. Null or 0 allows the model’s maximum. A value above the model’s maximum is lowered to it.
compactMaxTokensinteger | nullThe most a summary may be, in tokens, when compaction is on. Null: 40,000. A value above the model’s maximum is lowered to it.
{
"mode": "None",
"targetUtilization": 0,
"toolResultTrimmingMode": "Never",
"toolResultTrimmingMaxCycles": 0,
"toolResultTrimmingStyle": "Placeholder",
"toolResultTrimmingReplacement": "...",
"compactionType": "SameAgent",
"lowWaterUtilization": 0,
"compactAtUtilization": 0,
"compactKeepRecentTokens": 0,
"compactTargetTokens": 0,
"maxToolCallLoops": 0,
"responseMaxTokens": 0,
"compactMaxTokens": 0
}

Every field is present in a response; empty ones are null.

FieldTypeDescription
modeContextTrimmingModeWhat happens when the conversation no longer fits the model’s context window.
targetUtilizationnumberHow full the context window may get, as a fraction from 0 to 1, before the conversation is shortened.
toolResultTrimmingModeToolResultTrimmingModeWhen the results of earlier tool calls are replaced, to save space.
toolResultTrimmingMaxCyclesinteger | nullWith toolResultTrimmingMode set to AfterCycles or Both: once an agent has had this many turns, every tool result but the latest is replaced.
toolResultTrimmingStyleToolResultTrimmingStyle| nullWhat a replaced tool result becomes. Null: Placeholder.
effectiveToolResultTrimmingStyleToolResultTrimmingStyleThe style actually used: toolResultTrimmingStyle, or Placeholder when that is null. Set by Maitento.
toolResultTrimmingReplacementstringThe text a replaced tool result becomes, with the Placeholder style.
compactionTypeCompactionType| nullWhether, and how, older parts of a long conversation are summarised to make room. Suits long, many-turn conversations such as chats. Null: no summaries (None).
effectiveCompactionTypeCompactionTypeThe compaction actually used: compactionType, or None when that is null. Set by Maitento.
lowWaterUtilizationnumber | nullWith compaction on: how far a forced trim shortens the conversation, as a fraction of the context window from 0 to 1, so that it is not trimmed again on the very next turn. Null: 0.2. Never more than targetUtilization.
effectiveLowWaterUtilizationnumberThe low-water mark actually used: lowWaterUtilization when it is above 0 and at most 1, otherwise 0.2; never more than targetUtilization. Set by Maitento.
compactAtUtilizationnumberHow full the context window gets, as a fraction from 0 to 1, before the conversation is summarised (0.85 is 85% full).
compactKeepRecentTokensintegerThe most recent part of the conversation kept word for word when it is summarised, in tokens.
compactTargetTokensintegerThe length the summary aims for, in tokens. compactMaxTokens is the hard limit.
maxToolCallLoopsinteger | nullThe most rounds of tool calls an agent may make in one turn. After that its tools are withheld and it is told to answer. 0 means no limit; null means 10.
effectiveMaxToolCallLoopsintegerThe limit actually applied: maxToolCallLoops, or 10 when that is null. 0 means no limit. Set by Maitento.
responseMaxTokensinteger | nullThe most the model may write in one reply, in tokens, including any reasoning; that much of the context window is kept free for the reply. Null or 0 allows the model’s maximum. A value above the model’s maximum is lowered to it.
compactMaxTokensinteger | nullThe most a summary may be, in tokens, when compaction is on. Null: 40,000. A value above the model’s maximum is lowered to it.
{
"mode": "None",
"targetUtilization": 0,
"toolResultTrimmingMode": "Never",
"toolResultTrimmingMaxCycles": 0,
"toolResultTrimmingStyle": "Placeholder",
"effectiveToolResultTrimmingStyle": "Placeholder",
"toolResultTrimmingReplacement": "...",
"compactionType": "SameAgent",
"effectiveCompactionType": "SameAgent",
"lowWaterUtilization": 0,
"effectiveLowWaterUtilization": 0,
"compactAtUtilization": 0,
"compactKeepRecentTokens": 0,
"compactTargetTokens": 0,
"maxToolCallLoops": 0,
"effectiveMaxToolCallLoops": 0,
"responseMaxTokens": 0,
"compactMaxTokens": 0
}