Options for configuring the OpenAI Moderation middleware.
interface OpenAIModerationMiddlewareOptionsWhether to check user input messages.
Whether to check model output messages.
Whether to check tool result messages.
How to handle violations.
"error": Throw an error when content is flagged"end": End the agent execution and return a violation message"replace": Replace the flagged content with a violation messageModeration model to use.
Custom template for violation messages.
Available placeholders: {categories}, {category_scores}, {original_content}