DefaultTerminationStrategy Class
A default termination strategy that never terminates.
Note: This class is marked as 'experimental' and may change in the future.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Constructor
DefaultTerminationStrategy(*, maximum_iterations: int = 5, automatic_reset: bool = False, agents: list[Agent] = None)
Keyword-Only Parameters
| Name | Description |
|---|---|
|
maximum_iterations
|
Default value: 5
|
|
automatic_reset
Required
|
|
|
agents
Required
|
|
Methods
| should_agent_terminate |
Check if the agent should terminate. |
should_agent_terminate
Check if the agent should terminate.
async should_agent_terminate(agent: Agent, history: list[ChatMessageContent]) -> bool
Parameters
| Name | Description |
|---|---|
|
agent
Required
|
The agent to check. |
|
history
Required
|
The history of messages in the conversation. |
Returns
| Type | Description |
|---|---|
|
Defaults to False for the default strategy |
Attributes
is_experimental
is_experimental = True
maximum_iterations
maximum_iterations: int
stage_status
stage_status = 'experimental'