Skip to content

Commit c9b3d50

Browse files
committed
Add allow_exceptions field to RailsConfig
1 parent e260d5c commit c9b3d50

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nemoguardrails/rails/llm/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515

1616
"""Module for the configuration of rails."""
17+
1718
import logging
1819
import os
1920
from typing import Any, Dict, List, Optional, Set, Tuple, Union
@@ -484,6 +485,7 @@ def _join_config(dest_config: dict, additional_config: dict):
484485
"streaming",
485486
"passthrough",
486487
"raw_llm_call_action",
488+
"allow_exceptions",
487489
]
488490

489491
for field in additional_fields:
@@ -772,8 +774,13 @@ class RailsConfig(BaseModel):
772774
description="Whether this configuration should use streaming mode or not.",
773775
)
774776

775-
passthrough: Optional[bool] = Field(
776-
default=None,
777+
allow_exceptions: bool = Field(
778+
default=False,
779+
description="If true, allows the rails to throw/pass exceptions to the user.",
780+
)
781+
782+
passthrough: bool = Field(
783+
default=False,
777784
description="Weather the original prompt should pass through the guardrails configuration as is. "
778785
"This means it will not be altered in any way. ",
779786
)

0 commit comments

Comments
 (0)