Canstralian commited on
Commit
851e3a7
·
verified ·
1 Parent(s): 5596009

Create utils.py

Browse files
Files changed (1) hide show
  1. utils.py +16 -0
utils.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from prompts import PROMPTS
3
+
4
+ def get_prompt(vulnerability_type):
5
+ """
6
+ Fetch the prompt for a specific vulnerability type.
7
+ """
8
+ return PROMPTS.get(vulnerability_type, "No prompt available for this type.")
9
+
10
+ def save_results(output, file_name="results.json"):
11
+ """
12
+ Save the results to a JSON file.
13
+ """
14
+ with open(file_name, "w") as file:
15
+ json.dump(output, file, indent=4)
16
+ print(f"Results saved to {file_name}")