Skip to main content

OrTerminationCondition

Overview

OrTerminationCondition evaluates multiple termination rules and triggers a conversation termination if any of the specified conditions are satisfied. It allows combining different termination strategies for flexible control.

Input

  • List of termination conditions (e.g., TextMentionTermination, MaxMessageTermination)
  • Optional configuration for evaluation order or priorities

Output

  • Termination signal when at least one condition is met
  • Optional metadata indicating which condition triggered termination

Capabilities

  • Logical OR evaluation of multiple termination rules
  • Supports diverse condition types (text mention, message count, time limit)
  • Modular and extensible design for adding new conditions

Use Cases

  • Complex chatbot session control
  • Safety or compliance enforcement across multiple criteria
  • Automation workflows requiring flexible termination logic
  • Multi-condition conversation management

Behavior Notes

  • Checks all conditions in real-time or at configured intervals
  • Stops evaluation after the first condition is satisfied (depending on implementation)
  • Can log or report which condition caused termination

Limitations

  • Dependent on underlying termination condition implementations
  • Cannot combine with AND logic (use separate AndTerminationCondition)
  • Requires proper configuration to avoid premature termination

Example

Conditions:

  • TextMentionTermination for phrase "TERMINATE"
  • MaxMessageTermination with maximum 50 messages
    Result: Conversation ends if either condition is satisfied

Intended Audience

Developers and workflow engineers needing flexible, multi-condition termination for automated conversations or processes.