Skip to content

Conversation

@sydney-runkle
Copy link
Collaborator

@sydney-runkle sydney-runkle commented Nov 14, 2025

The trigger parameter now supports AND/OR logic via nested lists.
Top-level items are OR'd together, nested lists are AND'd together.

Before (OR logic only):

SummarizationMiddleware(
    ...,
    trigger=[("tokens", 3000), ("messages", 100)]
)
# Triggers when tokens >= 3000 OR messages >= 100

After (AND/OR logic):

SummarizationMiddleware(
    ...,
    trigger=[("messages", 10), [("tokens", 500), ("fraction", 0.8)]]
)
# Triggers when messages >= 10 OR (tokens >= 500 AND fraction >= 0.8)

@github-actions github-actions bot added feature langchain Related to the package `langchain` and removed feature labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature langchain Related to the package `langchain`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants