Files
defiQUG c052b07662
Some checks failed
Tests / test (3.10) (push) Has been cancelled
Tests / test (3.11) (push) Has been cancelled
Tests / test (3.12) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:42 -08:00

18 lines
583 B
Python

from typing import Any, Callable
from fusionagi._logger import logger
class OutcomeVerifier:
def __init__(self, verify_fn=None):
self._verify_fn = verify_fn
def verify(self, step_result, context=None):
ctx = context or {}
if self._verify_fn:
try:
return self._verify_fn(step_result, ctx)
except Exception:
logger.exception("OutcomeVerifier failed")
return False
if isinstance(step_result, dict) and step_result.get("error"):
return False
return True