foundation-model-stack / fms-guardrails-orchestrator

🚀 Guardrails orchestration server for application of various detections on text generation input and output.
https://foundation-model-stack.github.io/fms-guardrails-orchestrator/
Apache License 2.0
1 stars 14 forks source link

Failed to deserialize the JSON body into the target type: missing field `models` #91

Closed pmcjr closed 2 months ago

pmcjr commented 3 months ago

Describe the bug

When calling /api/v1/task/classification-with-text-generation with a missing models object inside guardrail_config.input or guardrail_config.output objects in the payload, a 422 Failed to deserialize the JSON body response occurs.

Platform

Please provide details about the environment you are using, including the following:

fms-orchestrator image version: fms-guardrails-orchestr8:e5b72c1

Observed behavior

Request body

{
    "inputs": "My email is",
    "model_id": "<model-id>",
    "guardrail_config": {
        "input": {
            "models": {}
        },
        "output": {
        }
    }
}

Response

Failed to deserialize the JSON body into the target type: guardrail_config.output: missing field `models` at line 9 column 3

Additional context

It happens for both guardrail_config.output and guardrail_config.input.

evaline-ju commented 2 months ago

Expected behavior: Something like {"code": 422, "details": <provide informative message about no models>} in line with other error messages

declark1 commented 2 months ago

Completed with https://github.com/foundation-model-stack/fms-guardrails-orchestrator/pull/99