Prometheus / curriculum.py
tbels89's picture
v1.0 new modular format
f80362a
Raw History Blame Contribute Delete
1.21 kB
# curriculum.py
from logging_config import logger
# Function to load the curriculum
def load_curriculum(file_path):
"""
Reads the curriculum text file and returns its content as a string.
Args:
file_path (str): Path to the text file.
Returns:
str: Contents of the text file.
"""
logger.info(f"Attempting to load curriculum from: {file_path}")
try:
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read().strip()
logger.info(f"Successfully loaded curriculum. Content length: {len(content)} characters.")
return content
except FileNotFoundError:
logger.error(f"The curriculum file '{file_path}' does not exist.")
return "Curriculum file not found."
except Exception as e:
logger.error(f"Error reading the curriculum file: {e}")
return "An error occurred while loading the curriculum."
# Define loaded curriculum as variable
CURRICULUM_FILE_PATH = './data/curriculum.txt'
logger.info(f"Initializing curriculum loading from path: {CURRICULUM_FILE_PATH}")
CURRICULUM_SUMMARY = load_curriculum(CURRICULUM_FILE_PATH)
logger.info("Curriculum loading complete.")