mirror of
https://github.com/hoshikawa2/nemo_guardrails_ci_cd.git
synced 2026-07-09 16:24:20 +00:00
17 lines
436 B
Python
17 lines
436 B
Python
import os
|
|
import pytest
|
|
from pathlib import Path
|
|
from nemoguardrails import RailsConfig, LLMRails
|
|
|
|
os.environ.setdefault("OPENAI_API_KEY", "sk-fake")
|
|
|
|
@pytest.fixture(scope="session")
|
|
def project_root():
|
|
return Path(__file__).resolve().parent.parent
|
|
|
|
@pytest.fixture(scope="session")
|
|
def rails(project_root):
|
|
config_path = project_root / "config"
|
|
config = RailsConfig.from_path(str(config_path))
|
|
return LLMRails(config)
|