Files
letta-server/memgpt/humans/humans.py
2023-10-13 01:34:33 -07:00

13 lines
423 B
Python

import os
DEFAULT = 'cs_phd'
def get_human_text(key=DEFAULT):
filename = key if key.endswith('.txt') else f'{key}.txt'
file_path = os.path.join(os.path.dirname(__file__), 'examples', filename)
if os.path.exists(file_path):
with open(file_path, 'r') as file:
return file.read().strip()
else:
raise FileNotFoundError(f"No file found for key {key}, path={file_path}")