Closed evaline-ju closed 2 months ago
When generated_text from an LLM is empty and any detectors are requested on classification-with-text-generation, this can trigger 500
generated_text
classification-with-text-generation
500
curl -v -H "Content-Type: application/json" --request POST \ --data '{"inputs": "!", "model_id": "my-model", "guardrail_config": { "input": { "models": {} }, "output": { "models": {} } } }' \ http://localhost:8033/api/v1/task/classification-with-text-generation
200 with no generated text (and no classification results, since the detectors would be acting on empty text
Potentially make sure contents is passed as [""] instead of "" or [] which could trigger 422 on detectors because contents is a required field on /api/v1/text/contents [ref. https://foundation-model-stack.github.io/fms-guardrails-orchestrator/?urls.primaryName=Detector+API#/default/text_content_analysis_unary_handler]
contents
[""]
""
[]
422
/api/v1/text/contents
Can you assign me on this one? Debugging this 🔍
Describe the bug
When
generated_text
from an LLM is empty and any detectors are requested onclassification-with-text-generation
, this can trigger500
Sample Code
Expected behavior
200 with no generated text (and no classification results, since the detectors would be acting on empty text
Observed behavior
500
Additional context
Potentially make sure
contents
is passed as[""]
instead of""
or[]
which could trigger422
on detectors becausecontents
is a required field on/api/v1/text/contents
[ref. https://foundation-model-stack.github.io/fms-guardrails-orchestrator/?urls.primaryName=Detector+API#/default/text_content_analysis_unary_handler]