@@ -215,7 +215,7 @@ async def create_chat_detection(request: ChatDetectionRequest, raw_request: Requ
215215 if isinstance (detector_response , ErrorResponse ):
216216 # ErrorResponse includes code and message, corresponding to errors for the detectorAPI
217217 return JSONResponse (
218- content = detector_response .model_dump (),
218+ content = detector_response .error . model_dump (),
219219 status_code = detector_response .error .code ,
220220 )
221221
@@ -238,7 +238,7 @@ async def create_context_doc_detection(
238238 if isinstance (detector_response , ErrorResponse ):
239239 # ErrorResponse includes code and message, corresponding to errors for the detectorAPI
240240 return JSONResponse (
241- content = detector_response .model_dump (),
241+ content = detector_response .error . model_dump (),
242242 status_code = detector_response .error .code ,
243243 )
244244
@@ -260,7 +260,7 @@ async def create_contents_detection(
260260 if isinstance (detector_response , ErrorResponse ):
261261 # ErrorResponse includes code and message, corresponding to errors for the detectorAPI
262262 return JSONResponse (
263- content = detector_response .model_dump (),
263+ content = detector_response .error . model_dump (),
264264 status_code = detector_response .error .code ,
265265 )
266266
@@ -282,7 +282,7 @@ async def create_generation_detection(
282282 if isinstance (detector_response , ErrorResponse ):
283283 # ErrorResponse includes code and message, corresponding to errors for the detectorAPI
284284 return JSONResponse (
285- content = detector_response .model_dump (),
285+ content = detector_response .error . model_dump (),
286286 status_code = detector_response .error .code ,
287287 )
288288
0 commit comments