Skip to content

StopperProtocol

gepa.utils.stop_condition.StopperProtocol

Bases: Protocol

Protocol for stop condition objects.

A stopper is a callable object that returns True when the optimization should stop.

Functions

__call__(gepa_state: GEPAState) -> bool

Check if the optimization should stop.

Parameters:

Name Type Description Default
gepa_state GEPAState

The current GEPA state containing optimization information

required

Returns:

Type Description
bool

True if the optimization should stop, False otherwise.

Source code in gepa/utils/stop_condition.py
def __call__(self, gepa_state: GEPAState) -> bool:
    """
    Check if the optimization should stop.

    Args:
        gepa_state: The current GEPA state containing optimization information

    Returns:
        True if the optimization should stop, False otherwise.
    """
    ...