Merge branch 'master' into fix-prompt-path

This commit is contained in:
Toran Bruce Richards
2023-04-04 21:02:35 +12:00
committed by GitHub
24 changed files with 836 additions and 221 deletions

View File

@@ -1,12 +1,17 @@
import os
from pathlib import Path
SRC_DIR = Path(__file__).parent
def load_prompt():
try:
# get directory of this file:
file_dir = Path(os.path.dirname(os.path.realpath(__file__)))
data_dir = file_dir / "data"
prompt_file = data_dir / "prompt.txt"
# Load the promt from data/prompt.txt
with open(SRC_DIR/ "data/prompt.txt", "r") as prompt_file:
prompt = prompt_file.read()
return prompt