MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / offer

Method offer

src/workflow/structured.py:56–67  ·  view source on GitHub ↗

Validate one emission. Returns ``(accepted, error_message)``.

(self, obj: Any)

Source from the content-addressed store, hash-verified

54 last_error: Optional[str] = None
55
56 def offer(self, obj: Any) -> tuple[bool, Optional[str]]:
57 """Validate one emission. Returns ``(accepted, error_message)``."""
58 if self.succeeded:
59 return True, None
60 self.attempts += 1
61 ok, error = validate_structured(obj, self.schema)
62 if ok:
63 self.value = obj
64 self.succeeded = True
65 return True, None
66 self.last_error = error
67 return False, error
68
69 @property
70 def exhausted(self) -> bool:

Calls 1

validate_structuredFunction · 0.85