Delete a Guardrail Configuration#

Choose one of the following options of deleting a guardrail configuration.

Set up a NeMoMicroservices client instance using the base URL of the NeMo Guardrails microservice and perform the task as follows.

import os
from nemo_microservices import NeMoMicroservices

client = NeMoMicroservices(
    base_url=os.environ["GUARDRAILS_BASE_URL"],
    inference_base_url=os.environ["NIM_BASE_URL"]
)
response = client.guardrail.configs.delete(namespace="default", config_name="demo-self-check-input-output")
print(response)

Make a DELETE request to the /v1/guardrail/configs/{namespace}/{config_name} endpoint.

curl -X DELETE "${GUARDRAILS_BASE_URL}/v1/guardrail/configs/default/demo-self-check-input-output" \
  -H 'Accept: application/json' | jq
Example Output
{
  "message": "Resource deleted successfully.",
  "id": "guardrail-GTtdc5KmFwWapFc2B6qKWi",
  "deleted_at": null
}