Skip to content

Commit 70afb23

Browse files
committed
Update paths to use utility functions
1 parent b6eec52 commit 70afb23

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

nemoguardrails/server/api.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from starlette.responses import JSONResponse, StreamingResponse
3030
from starlette.staticfiles import StaticFiles
3131

32-
from nemoguardrails import LLMRails, RailsConfig
32+
from nemoguardrails import LLMRails, RailsConfig, utils
3333
from nemoguardrails.rails.llm.options import (
3434
GenerationLog,
3535
GenerationOptions,
@@ -81,9 +81,8 @@
8181
)
8282

8383
# By default, we use the rails in the examples folder
84-
app.rails_config_path = os.path.normpath(
85-
os.path.join(os.path.dirname(__file__), "..", "..", "examples", "bots")
86-
)
84+
85+
app.rails_config_path = utils.get_examples_data_path("bots")
8786

8887
# Weather the chat UI is enabled or not.
8988
app.disable_chat_ui = False
@@ -430,9 +429,7 @@ async def startup_event():
430429
# Finally, we register the static frontend UI serving
431430

432431
if not app.disable_chat_ui:
433-
FRONTEND_DIR = os.path.join(
434-
os.path.dirname(__file__), "..", "..", "chat-ui", "frontend"
435-
)
432+
FRONTEND_DIR = utils.get_chat_ui_data_path("frontend")
436433

437434
app.mount(
438435
"/",

0 commit comments

Comments
 (0)