Skip to content

Commit 5cbbefc

Browse files
committed
docs(fix): replace img tag with Markdown images
Signed-off-by: Mike McKiernan <[email protected]>
1 parent 34a94c6 commit 5cbbefc

File tree

4 files changed

+41
-27
lines changed

4 files changed

+41
-27
lines changed

docs/getting-started/2-core-colang-concepts/README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,11 @@ In our "Hello World" example, the predefined messages "Hello world!" and "How ar
273273

274274
In the previous example, the LLM is prompted once. The following figure provides a summary of the outlined sequence of steps:
275275

276-
<div align="center">
277-
<img src="../../_static/puml/core_colang_concepts_fig_1.png" width="486">
278-
</div>
276+
```{image} ../../_static/puml/core_colang_concepts_fig_1.png
277+
:alt: "Sequence diagram showing the three main steps of processing a user greeting: 1) Computing the canonical form of the user message, 2) Determining the next step using flows, and 3) Generating the bot's response message"
278+
:width: 486px
279+
:align: center
280+
```
279281

280282
Let's examine the same process for the follow-up question "What is the capital of France?".
281283

@@ -321,9 +323,11 @@ Summary: 3 LLM call(s) took 1.79 seconds and used 1374 tokens.
321323

322324
Based on these steps, we can see that the `ask general question` canonical form is predicted for the user utterance "What is the capital of France?". Since there is no flow that matches it, the LLM is asked to predict the next step, which in this case is `bot response for general question`. Also, since there is no predefined response, the LLM is asked a third time to predict the final message.
323325

324-
<div align="center">
325-
<img src="../../_static/puml/core_colang_concepts_fig_2.png" width="686">
326-
</div>
326+
```{image} ../../_static/puml/core_colang_concepts_fig_2.png
327+
:alt: "Sequence diagram showing the three main steps of processing a follow-up question in NeMo Guardrails: 1) Computing the canonical form of the user message, such as 'ask general question' for 'What is the capital of France?', 2) Determining the next step using the LLM, such as 'bot response for general question', and 3) Generating the bot's response message. These are the steps to handle a question that doesn't have a predefined flow."
328+
:width: 586px
329+
:align: center
330+
```
327331

328332
## Wrapping up
329333

docs/getting-started/4-input-rails/README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@ print(info.llm_calls[0].completion)
283283

284284
The following figure depicts in more details how the self-check input rail works:
285285

286-
<div align="center">
287-
<img src="../../_static/puml/input_rails_fig_1.png" width="815">
288-
</div>
286+
```{image} ../../_static/puml/input_rails_fig_1.png
287+
:alt: "Sequence diagram showing how the self-check input rail works in NeMo Guardrails: 1) Application code sends a user message to the Programmable Guardrails system, 2) The message is passed to the Input Rails component, 3) Input Rails calls the self_check_input action, 4) The action uses an LLM to evaluate the message, 5) If the LLM returns 'Yes' indicating inappropriate content, the input is blocked and the bot responds with 'I am not able to respond to this.'"
288+
:width: 815px
289+
:align: center
290+
```
289291

290292
The `self check input` rail calls the `self_check_input` action, which in turn calls the LLM using the `self_check_input` task prompt.
291293

@@ -327,9 +329,11 @@ print(info.llm_calls[0].completion)
327329

328330
Because the input rail was not triggered, the flow continued as usual.
329331

330-
<div align="center">
331-
<img src="../../_static/puml/input_rails_fig_2.png" width="740">
332-
</div>
332+
```{image} ../../_static/puml/input_rails_fig_2.png
333+
:alt: "Sequence diagram showing how the self-check input rail works in NeMo Guardrails when processing a valid user message: 1) Application code sends a user message to the Programmable Guardrails system, 2) The message is passed to the Input Rails component, 3) Input Rails calls the self_check_input action, 4) The action uses an LLM to evaluate the message, 5) If the LLM returns 'No' (indicating appropriate content), the input is allowed to continue, 6) The system then proceeds to generate a bot response using the general task prompt"
334+
:width: 740px
335+
:align: center
336+
```
333337

334338
Note that the final answer is not correct.
335339

docs/user-guides/guardrails-process.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ This guide provides an overview of the main types of rails supported in NeMo Gua
66

77
NeMo Guardrails has support for five main categories of rails: input, dialog, output, retrieval, and execution. The diagram below provides an overview of the high-level flow through these categories of flows.
88

9-
<p style="text-align: center;">
10-
<img src="../_static/images/programmable_guardrails_flow.png" style="max-width: 913px; width: 75%;">
11-
</p>
9+
```{image} ../_static/images/programmable_guardrails_flow.png
10+
:alt: "High-level flow through the five main categories of guardrails in NeMo Guardrails: input rails for validating user input, dialog rails for controlling conversation flow, output rails for validating bot responses, retrieval rails for handling retrieved information, and execution rails for managing custom actions."
11+
:align: center
12+
```
1213

1314
## Categories of Rails
1415

@@ -28,24 +29,27 @@ There are five types of rails supported in NeMo Guardrails:
2829

2930
The diagram below depicts the guardrails process in detail:
3031

31-
<div aling="center">
32-
<img src="../_static/puml/master_rails_flow.png" width="75%">
33-
</div>
32+
```{image} ../_static/puml/master_rails_flow.png
33+
:alt: "Sequence diagram showing the complete guardrails process in NeMo Guardrails: 1) Input Validation stage where user messages are processed by input rails that can use actions and LLM to validate or alter input, 2) Dialog stage where messages are processed by dialog rails that can interact with a knowledge base, use retrieval rails to filter retrieved information, and use execution rails to perform custom actions, 3) Output Validation stage where bot responses are processed by output rails that can use actions and LLM to validate or alter output. The diagram shows all optional components and their interactions, including knowledge base queries, custom actions, and LLM calls at various stages."
34+
:width: 720px
35+
:align: center
36+
```
3437

3538
The guardrails process has multiple stages that a user message goes through:
3639

3740
1. **Input Validation stage**: The user input is first processed by the input rails. The input rails decide if the input is allowed, whether it should be altered or rejected.
3841
2. **Dialog stage**: If the input is allowed and the configuration contains dialog rails (i.e., at least one user message is defined), then the user message is processed by the dialog flows. This will ultimately result in a bot message.
3942
3. **Output Validation stage**: After a bot message is generated by the dialog rails, it is processed by the output rails. The Output rails decide if the output is allowed, whether it should be altered, or rejected.
4043

41-
4244
## The Dialog Rails Flow
4345

4446
The diagram below depicts the dialog rails flow in detail:
4547

46-
<p align="center">
47-
<img src="../_static/puml/dialog_rails_flow.png" width="500">
48-
</p>
48+
```{image} ../_static/puml/dialog_rails_flow.png
49+
:alt: "Sequence diagram showing the detailed dialog rails flow in NeMo Guardrails: 1) User Intent Generation stage where the system first searches for similar canonical form examples in a vector database, then either uses the closest match if embeddings_only is enabled, or asks the LLM to generate the user's intent. 2) Next Step Prediction stage where the system either uses a matching flow if one exists, or searches for similar flow examples and asks the LLM to generate the next step. 3) Bot Message Generation stage where the system either uses a predefined message if one exists, or searches for similar bot message examples and asks the LLM to generate an appropriate response. The diagram shows all the interactions between the application code, LLM Rails system, vector database, and LLM, with clear branching paths based on configuration options and available predefined content."
50+
:width: 500px
51+
:align: center
52+
```
4953

5054
The dialog rails flow has multiple stages that a user message goes through:
5155

@@ -59,6 +63,8 @@ The dialog rails flow has multiple stages that a user message goes through:
5963

6064
When the `single_llm_call.enabled` is set to `True`, the dialog rails flow will be simplified to a single LLM call that predicts all the steps at once. The diagram below depicts the simplified dialog rails flow:
6165

62-
<p align="center">
63-
<img src="../_static/puml/single_llm_call_flow.png" width="500">
64-
</p>
66+
```{image} ../_static/puml/single_llm_call_flow.png
67+
:alt: "Sequence diagram showing the simplified dialog rails flow in NeMo Guardrails when single LLM call is enabled: 1) The system first searches for similar examples in the vector database for canonical forms, flows, and bot messages. 2) A single LLM call is made using the generate_intent_steps_message task prompt to predict the user's canonical form, next step, and bot message all at once. 3) The system then either uses the next step from a matching flow if one exists, or uses the LLM-generated next step. 4) Finally, the system either uses a predefined bot message if available, uses the LLM-generated message if the next step came from the LLM, or makes one additional LLM call to generate the bot message. This simplified flow reduces the number of LLM calls needed to process a user message."
68+
:width: 600px
69+
:align: center
70+
```

docs/versions1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
{
33
"preferred": true,
44
"version": "0.13.0",
5-
"url": "../0.13.0"
5+
"url": "../0.13.0/"
66
},
77
{
88
"version": "0.12.0",
9-
"url": "../0.12.0"
9+
"url": "../0.12.0/"
1010
}
1111
]

0 commit comments

Comments
 (0)