diff --git a/examples/bots/abc_v2/_rails.co b/examples/bots/abc_v2/rails.co similarity index 53% rename from examples/bots/abc_v2/_rails.co rename to examples/bots/abc_v2/rails.co index 5eeba61d4..5b182c955 100644 --- a/examples/bots/abc_v2/_rails.co +++ b/examples/bots/abc_v2/rails.co @@ -1,5 +1,6 @@ import guardrails -import nemoguardrails.library +import nemoguardrails.library.self_check.output_check +import nemoguardrails.library.self_check.input_check flow input rails $input_text self check input diff --git a/nemoguardrails/rails/llm/config.py b/nemoguardrails/rails/llm/config.py index 674141881..0da97f729 100644 --- a/nemoguardrails/rails/llm/config.py +++ b/nemoguardrails/rails/llm/config.py @@ -51,7 +51,13 @@ standard_library_path = os.path.normpath( os.path.join(os.path.dirname(__file__), "..", "..", "colang", "v2_x", "library") ) + +# nemoguardrails/lobrary +guardrails_stdlib_path = os.path.normpath( + os.path.join(os.path.dirname(__file__), "..", "..", "..") +) colang_path_dirs.append(standard_library_path) +colang_path_dirs.append(guardrails_stdlib_path) class Model(BaseModel): @@ -653,7 +659,10 @@ def _load_imported_paths(raw_config: dict, colang_files: List[Tuple[str, str]]): actual_path = import_path if actual_path is None: - raise ValueError(f"Import path `{import_path}` could not be resolved.") + formated_import_path = import_path.replace("/", ".") + raise ValueError( + f"Import path '{formated_import_path}' could not be resolved.", + ) _raw_config, _colang_files = _load_path(actual_path)