You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oss/langchain/middleware/built-in.mdx
+44-10Lines changed: 44 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,21 +125,24 @@ const agent = createAgent({
125
125
Model for generating summaries. Can be a model identifier string (e.g., `'openai:gpt-5.4-mini'`) or a `BaseChatModel` instance. See @[`init_chat_model`][init_chat_model(model)] for more information.
Condition(s) for triggering summarization. Can be:
130
130
131
-
- A single @[`ContextSize`] tuple (specified condition must be met)
132
-
- A list of @[`ContextSize`] tuples (any condition must be met - OR logic)
131
+
- A single @[`ContextSize`] tuple (the specified threshold must be met)
132
+
- A single @[`TriggerClause`] dict (all specified thresholds must be met - AND logic)
133
+
- A list mixing either form (any item must be met - OR logic)
133
134
134
-
Condition should be one of the following:
135
+
Supported thresholds are:
135
136
136
137
-`fraction` (float): Fraction of model's context size (0-1)
137
138
-`tokens` (int): Absolute token count
138
139
-`messages` (int): Message count
139
140
140
-
At least one condition must be specified. If not provided, summarization will not trigger automatically.
141
+
A @[`ContextSize`] tuple expresses exactly one threshold. A @[`TriggerClause`] dict can include one or more thresholds, e.g. `{"tokens": 4000, "messages": 10}`, and all thresholds in the dict must be met (AND).
141
142
142
-
See the API reference for @[`ContextSize`] for more information.
143
+
Each @[`TriggerClause`] dict must specify at least one threshold. If `trigger` is not provided, summarization will not trigger automatically.
144
+
145
+
See the API reference for @[`ContextSize`] and @[`TriggerClause`] for more information.
0 commit comments