langgoap.SafeTracerProxy#
- class SafeTracerProxy(inner)[source]#
Wrap a
PlanningTracerso every hook call is exception-safe.__getattr__intercepts attribute access, returning an error-swallowing wrapper for callables and the raw value for everything else (so attributes likereflectionskeep working transparently).Usage:
tracer = LangSmithTracer() safe = SafeTracerProxy(tracer) safe.on_plan_start(goal, state, "AStar") # never raises
The proxy is itself a valid
PlanningTracerbecause the Protocol is structural and the proxy responds to every hook name via__getattr__. Hooks the wrapped tracer does not implement resolve to no-ops, so a tracer written against an older protocol never changes execution outcomes.Idempotent wrapping:
SafeTracerProxy(SafeTracerProxy(t))is indistinguishable fromSafeTracerProxy(t)because the proxy flattens itself in__init__().- Parameters:
inner (PlanningTracer)
- __init__(inner)[source]#
- Parameters:
inner (PlanningTracer)
- Return type:
None
Methods
__init__(inner)Attributes
innerThe wrapped tracer (read-only handle for tests / introspection).