Create utils.py
Browse files
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}")
|