Repository: ThuCCSLab/JailbreakEval (language: python)

Issue:
[BUG] Unit test fails
**Describe the bug**
Some unit test failed.

**To Reproduce**
Steps to reproduce the behavior:
Simply run `make pre-commit-check`, and the results are
```
========================================== short test summary info ===========================================
FAILED tests/evaluators/test_chat_evaluator.py::test_transformers_pipeline - AssertionError: expected call not found.
FAILED tests/evaluators/test_text_classification_evaluator.py::test_openai - pydantic_core._pydantic_core.ValidationError: 1 validation error for Moderation
FAILED tests/services/chat/test_transformers_pipeline_service.py::test_predict - AssertionError: expected call not found.
FAILED tests/services/text_classification/test_openai_service.py::test_predict - pydantic_core._pydantic_core.ValidationError: 1 validation error for Moderation
================================== 4 failed, 16 passed, 4 warnings in 4.40s ==================================
```

**Expected behavior**
All tests should success.

**System (please complete the following information):**
 - OS: Ubuntu
 - Version: 22.04



Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index fb6e831..e1653f8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,7 +17,7 @@ classifiers = [
     "License :: OSI Approved :: MIT License",
 ]
 dependencies = [
-    "openai>=1.0.0",
+    "openai>=1.49.0",
     "google-api-python-client",
     "scikit-learn",
     "PyYAML",


Test patch:
diff --git a/tests/testing_utils.py b/tests/testing_utils.py
index ae5f2dc..48cac7b 100644
--- a/tests/testing_utils.py
+++ b/tests/testing_utils.py
@@ -6,7 +6,7 @@
 from openai.types import CompletionUsage, ModerationCreateResponse
 from openai.types.chat import ChatCompletionMessage
 from openai.types.chat.chat_completion import ChatCompletion, Choice
-from openai.types.moderation import Moderation, Categories, CategoryScores
+from openai.types.moderation import Moderation, Categories, CategoryScores, CategoryAppliedInputTypes
 from transformers.pipelines import TextGenerationPipeline, TextClassificationPipeline
 from transformers import PreTrainedModel
 
@@ -83,7 +83,10 @@ def openai_moderations(response: Union[bool, List[bool]]):
             model="mock-model",
             results=[
                 Moderation(
-                    flagged=response, categories=Categories.construct(), category_scores=CategoryScores.construct()
+                    flagged=response,
+                    category_applied_input_types=CategoryAppliedInputTypes.construct(),
+                    categories=Categories.construct(),
+                    category_scores=CategoryScores.construct(),
                 )
             ],
         )