Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rust toolchain (installed for nemo_flow PyO3 build)
# Rust toolchain (installed for nemo_relay PyO3 build)
.cargo/
.rustup/

Expand Down Expand Up @@ -296,7 +296,7 @@ agents/**/traces/
.config/
.local/

# Rust toolchain (installed by rustup for nemo-flow build)
# Rust toolchain (installed by rustup for nemo-relay build)
.cargo/
.rustup/

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A progressive tour of the framework. Each step is a standalone, copy-paste-runna
| 9 | Automatic history summarization | [`09_summarization.py`](quickstart/09_summarization.py) |
| 10 | Skills | [`10_skills.py`](quickstart/10_skills.py) |
| 11 | MCP tools | [`11_mcp.py`](quickstart/11_mcp.py) |
| — | Sandbox, memory, multimodal, NeMo Flow | see the [Advanced](#advanced-topics) section |
| — | Sandbox, memory, multimodal, NeMo Relay | see the [Advanced](#advanced-topics) section |

---

Expand Down
144 changes: 69 additions & 75 deletions examples/quickstart/15_nemo_relay.py

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ nooa-bench = { workspace = true }
[tool.uv]
# Extra index URLs to search for packages (in addition to PyPI)
# Ignore packages uploaded less than 7 days ago to mitigate supply-chain attacks
exclude-newer = "2026-07-03T00:00:00Z"
exclude-newer = "2026-07-23T00:00:00Z"
# Match the package's supported Python range and LiteLLM's stable releases.
environments = [
"python_full_version >= '3.12' and python_full_version < '3.14'",
Expand Down Expand Up @@ -120,11 +120,22 @@ sandbox = [
mcp = [
"mcp>=1.0.0",
]
# NeMo Flow integration (guardrails, intercepts, event subscribers, ATIF
# export). The upstream package was renamed from nemo-flow to nemo-relay.
# See src/nooa/nemo_flow_middleware.py and examples/quickstart/15_nemo_relay.py.
# NeMo Relay integration (guardrails, intercepts, event subscribers, ATIF
# export).
# See src/nooa/nemo_relay_middleware.py and examples/quickstart/15_nemo_relay.py.
#
# Floor is 0.6: LLM request intercepts must return `LLMRequestInterceptOutcome`
# (0.5+) rather than a `(request, annotated)` tuple, and that type does not
# exist in 0.4 — so there is no single callback shape that spans 0.4 and 0.6.
#
# Ceiling is <0.7: 0.7 changes the LLM sanitizer contract to the two-argument
# form `(payload, directional_context) -> payload | None` with no compatibility
# shim, and makes an implicit `return` mean "omit the payload" (fail-closed).
# Our library code (nemo_relay_middleware.py) registers no sanitizers and is
# unaffected, but tests/test_nemo_relay_middleware.py does — see the sanitizer
# registrations there before lifting this bound.
nemo-relay = [
"nemo-relay>=0.4.0",
"nemo-relay>=0.6,<0.7",
]

# CLI ships as a separate package: `uv add nooa-cli`.
Expand Down
2 changes: 1 addition & 1 deletion skills/nooa-middleware-hooks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Verified semantics:
- On a context-window error the runtime archives events, rebuilds messages, and retries — so `llm_call` middleware can run more than once per logical turn; keep it idempotent.
- The tracing `on_messages_built` hook fires inside the innermost core, so traces show the **post-middleware** messages.

Worked production example: `src/nooa/nemo_flow_middleware.py` installs all three kinds to route calls through NeMo Flow (guardrails/ATIF); `nemo_flow_scope(agent, name)` wraps install/uninstall. Runnable: `examples/quickstart/13_nemo_flow.py`. Test patterns (mutate/short-circuit/ordering): `tests/test_event_middleware.py`.
Worked production example: `src/nooa/nemo_relay_middleware.py` installs all three kinds to route calls through NeMo Relay (guardrails/ATIF); `nemo_relay_scope(agent, name)` wraps install/uninstall. Runnable: `examples/quickstart/13_nemo_relay.py`. Test patterns (mutate/short-circuit/ordering): `tests/test_event_middleware.py`.

## Observers (`on`)

Expand Down
250 changes: 170 additions & 80 deletions src/nooa/nemo_flow_middleware.py → src/nooa/nemo_relay_middleware.py

Large diffs are not rendered by default.

43 changes: 0 additions & 43 deletions tests/test_nemo_flow_middleware_no_dep.py

This file was deleted.

Loading
Loading