Skip to content

Commit 199de11

Browse files
gkumbhatevaline-ju
andauthored
Apply suggestions from code review
Co-authored-by: Evaline Ju <[email protected]> Signed-off-by: Gaurav Kumbhat <[email protected]>
1 parent f5267fc commit 199de11

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

vllm_detector_adapter/generative_detectors/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def preprocess_request( # noqa: F811
115115
@detector_dispatcher(types=[DetectorType.TEXT_CONTENT])
116116
def preprocess_request( # noqa: F811
117117
self, request: ContentsDetectionRequest
118-
) -> Union[ContentsDetectionRequest, ErrorResponse]:
119-
"""Preprocess contents request and convert it into appropriate chat request"""
118+
) -> Union[List[ChatCompletionRequest], ErrorResponse]:
119+
"""Preprocess contents request and convert it into appropriate chat requests"""
120120
# pylint: disable=redefined-outer-name
121121
# Fetch model name from super class: OpenAIServing
122122
model_name = self.models.base_model_paths[0].name
@@ -289,7 +289,7 @@ async def content_analysis(
289289
self,
290290
request: ContentsDetectionRequest,
291291
raw_request: Optional[Request] = None,
292-
):
292+
) -> Union[ContentsDetectionResponse, ErrorResponse]:
293293
"""Function used to call chat detection and provide a /text/contents response"""
294294

295295
# Apply task template if it exists

vllm_detector_adapter/generative_detectors/llama_guard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def content_analysis(
112112
processed_result = []
113113
for result in results:
114114
# NOTE: we are only sending 1 of the error results
115-
# and not every or not cumulative
115+
# and not every one (not cumulative)
116116
if isinstance(result, ErrorResponse):
117117
return result
118118
else:

vllm_detector_adapter/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ContentsDetectionRequest(BaseModel):
2727
]
2828
)
2929
# Parameter passthrough
30-
# NOTE: this server does support optional, `role_override`` parameter
30+
# NOTE: this endpoint does support the optional `role_override` parameter
3131
# which allows use of different role when making a call to the guardrails LLM
3232
# via chat/completions
3333
detector_params: Optional[Dict] = {}

0 commit comments

Comments
 (0)