Skip to content

Commit f1666e5

Browse files
committed
deleted detect_async method
1 parent 6e5fd49 commit f1666e5

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

tests/zenguard_e2e_test.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@ def test_detect_in_parallel_pass_on_detectors(zenguard):
9797
assert "error" not in response
9898

9999

100-
def test_prompt_injection_async(zenguard):
101-
prompt = "Simple prompt injection test"
102-
detectors = [Detector.PROMPT_INJECTION]
103-
zenguard.detect_async(detectors=detectors, prompt=prompt)
104-
105-
106-
def test_detect_error_no_detectors(zenguard):
107-
prompt = "Simple prompt injection test"
108-
with pytest.raises(ValueError):
109-
zenguard.detect_async([], prompt)
110-
111-
112100
def test_report_with_valid_detector_and_days(zenguard):
113101
with patch("httpx.get") as mock_post:
114102
mock_response = Mock()

zenguard/zenguard.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ def detect(self, detectors: list[Detector], prompt: str):
147147
f"An error occurred while making the request: {str(e)}"
148148
) from e
149149

150-
def detect_async(self, detectors: list[Detector], prompt: str):
151-
"""
152-
Same as detect function but asynchroneous.
153-
"""
154-
return self.detect(detectors, prompt)
155-
156150
def _attack_zenguard(self, detector: Detector, attacks: list[str]):
157151
attacks = tqdm(attacks)
158152
for attack in attacks:

0 commit comments

Comments
 (0)