docs(iorails): Use Guardrails entry-point not IORails - #1892
Conversation
📝 WalkthroughWalkthroughThis PR updates documentation across observability and troubleshooting guides to reflect the newer IORails routing pattern. The OpenTelemetry integration example now shows ChangesOpenTelemetry and Metrics Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Documentation preview |
Greptile SummaryThis PR updates two documentation files to replace direct
|
| Filename | Overview |
|---|---|
| docs/observability/metrics/opentelemetry-integration.md | Prose and code example updated from IORails(config) to Guardrails(config, use_iorails=True) with corrected import. One "IORails metrics" phrase on line 151 was not updated, and the import uses an internal module path not in the public API. |
| docs/troubleshooting.md | All IORails direct-construction references updated to document both Guardrails(config, use_iorails=True) and the LLMRails/NEMO_GUARDRAILS_IORAILS_ENGINE=1 backwards-compatible path. Terminology consistently updated to "IORails engine". |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Application] --> B{Entry Point Choice}
B -->|New Apps| C["Guardrails(config, use_iorails=True)"]
B -->|Backwards-Compatible| D["NEMO_GUARDRAILS_IORAILS_ENGINE=1 + LLMRails(config)"]
C --> E[Guardrails wrapper]
D --> F["LLMRails redirected to Guardrails wrapper"]
E --> G{IORails available?}
F --> G
G -->|Yes| H[IORails engine - emits OTel metrics]
G -->|No| I[LLMRails engine - no metrics]
H --> J[generate_async / stream_async]
I --> J
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
docs/observability/metrics/opentelemetry-integration.md:151
One residual "IORails" reference was missed in this section header sentence. The surrounding sections were updated to use "IORails engine" or "Guardrails", but this line still says "IORails metrics" as a noun, inconsistent with the rest of the PR.
```suggestion
You can export IORails engine metrics to any backend that accepts OpenTelemetry metric data, including:
```
### Issue 2 of 2
docs/observability/metrics/opentelemetry-integration.md:86
**Internal import path in public documentation**
`Guardrails` is imported directly from `nemoguardrails.guardrails.guardrails`, which is an internal module that does not appear in `nemoguardrails.__all__` and is not re-exported by the `nemoguardrails.guardrails` subpackage. Readers following this example are effectively depending on an undocumented internal path. If `Guardrails(config, use_iorails=True)` is the intended public entry point for new apps, it should be added to `nemoguardrails/__init__.py` and `__all__` so that `from nemoguardrails import Guardrails` works.
Reviews (3): Last reviewed commit: "Greptile feedback" | Re-trigger Greptile
Description
The docs contained several references to creating IORails(config) directly. IORails shouldn't be created directly in this way, there are two possible options:
NEMO_GUARDRAILS_IORAILS_ENGINE=1.use_iorailsset. This will use IORails if possible, falling back to LLMRails if needed.Related Issue(s)
VDR Issue 8
Checklist