Skip to content

Commit 00ba66b

Browse files
refactored AutoGuard to AutoAlign-2
1 parent 27769e8 commit 00ba66b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/user_guides/guardrails-library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ define flow
721721
### AutoAlign
722722

723723
NeMo Guardrails provides an interface for using the AutoAlign's guardrails
724-
(you need to have the `AUTOGUARD_API_KEY` environment variable set).
724+
(you need to have the `AUTOALIGN_API_KEY` environment variable set).
725725

726726

727727
Following is the list of guardrails that are currently supported:

nemoguardrails/library/autoalign/actions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ async def autoalign_infer(
132132
show_toxic_phrases: bool = False,
133133
):
134134
"""Checks whether the given text passes through the applied guardrails."""
135-
api_key = os.environ.get("AUTOGUARD_API_KEY")
135+
api_key = os.environ.get("AUTOALIGN_API_KEY")
136136
if api_key is None:
137-
raise ValueError("AUTOGUARD_API_KEY environment variable not set.")
137+
raise ValueError("AUTOALIGN_API_KEY environment variable not set.")
138138

139139
headers = {"x-api-key": api_key}
140140
config = DEFAULT_CONFIG.copy()
@@ -176,9 +176,9 @@ async def autoalign_factcheck_infer(
176176
documents: List[str],
177177
):
178178
"""Checks the facts for the text using the given documents and provides a fact-checking score"""
179-
api_key = os.environ.get("AUTOGUARD_API_KEY")
179+
api_key = os.environ.get("AUTOALIGN_API_KEY")
180180
if api_key is None:
181-
raise ValueError("AUTOGUARD_API_KEY environment variable not set.")
181+
raise ValueError("AUTOALIGN_API_KEY environment variable not set.")
182182
headers = {"x-api-key": api_key}
183183
request_body = {
184184
"prompt": text,

0 commit comments

Comments
 (0)