Bases: StopperProtocol
Stop callback that stops after a specified timeout.
Source code in gepa/utils/stop_condition.py
| def __init__(self, timeout_seconds: float):
self.timeout_seconds = timeout_seconds
self.start_time = time.time()
|
Attributes
timeout_seconds = timeout_seconds
instance-attribute
start_time = time.time()
instance-attribute
Functions
__call__(gepa_state: GEPAState) -> bool
Source code in gepa/utils/stop_condition.py
| def __call__(self, gepa_state: GEPAState) -> bool:
# return true if timeout has been reached
return time.time() - self.start_time > self.timeout_seconds
|