Files
Auto-GPT/scripts/data.py
Taylor Brown 80ccd10d0b Use gpt-4 by default for the main thought process
Allow specifying the llm through dotenv
Move more things into config
2023-04-02 21:35:28 -05:00

19 lines
522 B
Python

import os
from pathlib import Path
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(prompt_file, "r") as prompt_file:
prompt = prompt_file.read()
return prompt
except FileNotFoundError:
print("Error: Prompt file not found", flush=True)
return ""