From 817cbc8a4242744d5abb7a0c1b13f6b779f0eef5 Mon Sep 17 00:00:00 2001 From: Swapna Lekkala Date: Tue, 5 Aug 2025 21:56:56 -0700 Subject: [PATCH] update documentation with required categories --- docs/_static/llama-stack-spec.html | 2 +- docs/_static/llama-stack-spec.yaml | 4 ++++ llama_stack/apis/safety/safety.py | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index ea58453d2..d480ff592 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -16530,7 +16530,7 @@ "additionalProperties": { "type": "number" }, - "description": "A list of the categories along with their scores as predicted by model." + "description": "A list of the categories along with their scores as predicted by model. Required set of categories that need to be in response - violence - violence/graphic - harassment - harassment/threatening - hate - hate/threatening - illicit - illicit/violent - sexual - sexual/minors - self-harm - self-harm/intent - self-harm/instructions" }, "user_message": { "type": "string" diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index 05b742ca4..9c0fba554 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -12286,6 +12286,10 @@ components: type: number description: >- A list of the categories along with their scores as predicted by model. + Required set of categories that need to be in response - violence - violence/graphic + - harassment - harassment/threatening - hate - hate/threatening - illicit + - illicit/violent - sexual - sexual/minors - self-harm - self-harm/intent + - self-harm/instructions user_message: type: string metadata: diff --git a/llama_stack/apis/safety/safety.py b/llama_stack/apis/safety/safety.py index 25ee03ec1..87cefe8e4 100644 --- a/llama_stack/apis/safety/safety.py +++ b/llama_stack/apis/safety/safety.py @@ -22,6 +22,20 @@ class ModerationObjectResults(BaseModel): :param categories: A list of the categories, and whether they are flagged or not. :param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to. :param category_scores: A list of the categories along with their scores as predicted by model. + Required set of categories that need to be in response + - violence + - violence/graphic + - harassment + - harassment/threatening + - hate + - hate/threatening + - illicit + - illicit/violent + - sexual + - sexual/minors + - self-harm + - self-harm/intent + - self-harm/instructions """ flagged: bool