You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Factcheck is implemented a bit differently, compared to other guardrails.
@@ -25,14 +25,14 @@ Please have a look at its description within this document to understand its usa
25
25
In order to use AutoGuard's guardrails you need to set `AUTOGUARD_API_KEY` as an environment variable in your system,
26
26
with the API key as its value.
27
27
28
-
Please contact [[email protected]](mailto:[email protected]) for your own API key. Please mention NeMo and AutoGuard in the subject line in order to receive quick responses fron the AutoAlign team.
28
+
Please contact [[email protected]](mailto:[email protected]) for your own API key. Please mention NeMo and AutoGuard in the subject line in order to receive quick responses from the AutoAlign team.
29
29
30
30
31
31
## Usage (AutoGuard)
32
32
33
33
To use the autoguard's guardrails:
34
34
35
-
You have to configure the guardrails in a dictionary under`guardrails_config` section, which you can provide for both `input`
35
+
You have to configure the guardrails using the`guardrails_config` section, which you can provide for both `input`
36
36
section and `output` sections that come under `autoguard` section in `config.yml` file:
37
37
38
38
```yaml
@@ -261,38 +261,38 @@ rails:
261
261
}
262
262
input:
263
263
flows:
264
-
- call autoguard input
264
+
- autoguard check input
265
265
output:
266
266
flows:
267
-
- call autoguard output
267
+
- autoguard check output
268
268
```
269
269
We also have to add the autoguard's endpoint in parameters.
270
270
271
-
One of the advanced configs is matching score (ranging between 0 to 1) which is a threshold that determines whether the guardrail will block the input/output or not.
271
+
One of the advanced configs is matching score (ranging between 0 and 1) which is a threshold that determines whether the guardrail will block the input/output or not.
272
272
If the matching score is higher (i.e. close to 1) then the guardrail will be more strict.
273
273
Some guardrails have very different format of `matching_scores` config,
274
274
in each guardrail's description we have added an example to show how `matching_scores`
275
275
has been implemented for that guardrail.
276
276
PII has some more advanced config like `contextual_rules` and `enabled_types`, more details can be read in the PII section
277
277
given below.
278
278
279
-
**Please note that** all the additional configs such as `matching_scores`, `contextual_rules`, and `enabled_types` are optiona; if they are not specified then the default valus will be applied.
279
+
**Please note that** all the additional configs such as `matching_scores`, `contextual_rules`, and `enabled_types` are optional; if they are not specified then the default values will be applied.
280
280
281
281
The config for the guardrails has to be defined separately for both input and output side, as shown in the above example.
282
282
283
283
284
-
The colang file has to be in the following format:
284
+
The colang file has been implemented in the following format in the library:
"$bot_message Factcheck output violation has been detected by AutoGuard."
597
+
"$bot_message Factcheck output violation has been detected by AutoGuard."
599
598
```
600
599
601
-
Within the subflow you have to execute a custom relevant chunk extraction action `autoguard_retrieve_relevant_chunks`,
602
-
so that the documents are passed in the context for the guardrail.
600
+
Within the flow you can see we have an action for custom relevant chunk extraction, `autoguard_retrieve_relevant_chunks_input`,
601
+
which ensures that the documents are passed in the context for the guardrail while using it for user input.
603
602
604
603
The output of the factcheck endpoint provides you with a factcheck score against which we can add a threshold which determines whether the given output is factually correct or not.
0 commit comments