Post · 1 min read· p. 219

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.

Methods:

__call__(gepa_state: GEPAState) -> bool

Check if the optimization should stop.

Parameters:

NameTypeDescriptionDefault
gepa_stateGEPAStateThe current GEPA state containing optimization informationrequired

Returns:

TypeDescription
boolTrue if the optimization should stop, False otherwise.

Source code in gepa/utils/stop_condition.py

text
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.
    """
    ...