shawhin commited on
Commit
d147352
·
1 Parent(s): ac6ca9f

updated prompt pathnames

Browse files
Files changed (2) hide show
  1. src/functions.py +4 -1
  2. src/main.py +3 -1
src/functions.py CHANGED
@@ -59,5 +59,8 @@ def fetch_intstructions(prompt_name: str) -> str:
59
  Returns:
60
  str: Instructions for the given prompt
61
  """
62
- with open(f"prompts/{prompt_name}.md", "r") as f:
 
 
 
63
  return f.read()
 
59
  Returns:
60
  str: Instructions for the given prompt
61
  """
62
+ import os
63
+ script_dir = os.path.dirname(__file__)
64
+ prompt_path = os.path.join(script_dir, "prompts", f"{prompt_name}.md")
65
+ with open(prompt_path, "r") as f:
66
  return f.read()
src/main.py CHANGED
@@ -57,7 +57,9 @@ async def run_streamlit_app():
57
 
58
  # Load system instructions
59
  try:
60
- with open("prompts/system_instructions.md", "r") as f:
 
 
61
  system_instructions = f.read()
62
 
63
  st.session_state.agent = Agent(
 
57
 
58
  # Load system instructions
59
  try:
60
+ script_dir = os.path.dirname(__file__)
61
+ prompts_path = os.path.join(script_dir, "prompts", "system_instructions.md")
62
+ with open(prompts_path, "r") as f:
63
  system_instructions = f.read()
64
 
65
  st.session_state.agent = Agent(