Skip to content

Commit

Permalink
added so default descriptions runs if no logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zibiax committed May 6, 2024
1 parent 82d07f0 commit 7e09c7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test_draftgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def draft_gpt(user_input, openai_api_key=os.environ["OPENAI_API_KEY"], gpt_model
incident_desc = response.text
else:
print("Failed to fetch file:", response.status_code)
else:
elif input_logfile is not None:
with open(input_logfile, "r") as file:
incident_desc = file.read()
incident_desc = file.read().strip()
else:
with open("incident_descriptions/incident_description.txt", "r") as file:
incident_desc = file.read().strip()

print("\n contents of file read == \n")
print(incident_desc)
Expand Down

0 comments on commit 7e09c7a

Please sign in to comment.