From 6fd8622ef1cb77e3086fffbf071df64475f4aa72 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Sat, 13 Jul 2024 13:05:32 +0200 Subject: [PATCH] Fix path to prompt.txt --- gut.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gut.py b/gut.py index fe07f35..545d1e8 100644 --- a/gut.py +++ b/gut.py @@ -24,7 +24,9 @@ def request_api_key(): return api_key def send_to_groq(git_output): - with open('prompt.txt', 'r') as f: + # Construct the path to 'prompt.txt' using os.path.join and os.path.dirname + prompt_path = os.path.join(os.path.dirname(__file__), 'prompt.txt') + with open(prompt_path, 'r') as f: prompt = f.read().strip() url = "https://api.groq.com/openai/v1/chat/completions" @@ -54,4 +56,4 @@ def status(): click.echo(result) if __name__ == '__main__': - cli() \ No newline at end of file + cli() -- 2.51.2