Class ModerationResponse


public class ModerationResponse extends ObjectWithJsonToString
Configuration for a mocked OpenAI Moderations endpoint response (POST /v1/moderations). Production LLM agents call the moderations endpoint to decide whether user or model content should be blocked; mocking it lets those agents be tested deterministically against both flagged and not-flagged verdicts.

The wire shape is OpenAI's: {"id":..,"model":..,"results":[{"flagged":bool,"categories":{..},"category_scores":{..}}]}. Every category named in getFlaggedCategories() is marked true (with a high score) and the top-level flagged is true when the list is non-empty; all other categories are false (with a low score). An empty/absent list yields a fully not-flagged verdict — the safe default.

Follows the model field/withX/getter convention so it round-trips through the schema-validated expectation JSON without a bespoke (de)serializer.