fix:增加llm结果鲁棒性
This commit is contained in:
@@ -60,7 +60,10 @@ def detectGPT(content: str):
|
||||
|
||||
classified_results = {"high": [], "medium": [], "low": [], "none": []}
|
||||
for res in res_json:
|
||||
try:
|
||||
classified_results[res["Risk"]].append(
|
||||
(res["Line"], text.split("\n")[res["Line"] - 1].strip())
|
||||
)
|
||||
except IndexError:
|
||||
pass
|
||||
return classified_results
|
||||
|
Reference in New Issue
Block a user