Skip to content

Commit

Permalink
Fix explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Apr 20, 2024
1 parent ec4c8e4 commit 26b17fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aisploit/classifiers/package_hallucination.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def score(self, input: str) -> Score[List[str]]:
flagged=len(hallucinated_package) > 0,
value=hallucinated_package,
description="Return True if hallucinated packages are found in the input",
explanation="Did not find token in input",
explanation=(
f"Found {len(hallucinated_package)} packages in input"
if len(hallucinated_package) > 0
else "Did not find hallucinated packages in input"
),
)

def _get_imported_packages(self, input: str) -> List[str]:
Expand Down

0 comments on commit 26b17fd

Please sign in to comment.