Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(hooks): remove_hook takes the installed instance, so the example must keep it

Adeshina Lasisi1fa4458febae
diff --git a/docs/hooks/examples.md b/docs/hooks/examples.md
index 6222708f..96d49e1e 100644
--- a/docs/hooks/examples.md
+++ b/docs/hooks/examples.md
@@ -322,13 +322,17 @@ agent.system_one(state, questions)
Attach, detach or scope hooks after construction.
```python
-agent.add_hook(Metrics()) # attach at runtime
-agent.remove_hook(Metrics()) # by identity
+metrics = Metrics()
+agent.add_hook(metrics) # attach at runtime
+agent.remove_hook(metrics) # by identity: keep the instance to remove it
with agent.hooks_installed(DebugDump()):
agent.system_one(state, questions) # DebugDump only here
```
+`remove_hook` compares with `is`, so a fresh `Metrics()` matches nothing: it returns `False` and
+the installed hook keeps running.
+
## Base class and process-wide defaults
Subclass `BaseHook` to override only what you need, and register something once for the whole