File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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 ] = {}
You can’t perform that action at this time.
0 commit comments