Why Moderations
- Identifying harmful requests and take action, for example, by filtering it.
- Ensuring any inappropriate or harmful content in user messages is flagged and prevented from being processed.
- Maintaining the safety of the interactions with your application.
Getting Started
Moderations currently work with OpenAI models only (gpt-4, gpt-3.5-turbo, etc.) as it uses OpenAI’s moderation endpoint.
Helicone-Moderations-Enabled
to true
.
The moderation call to the OpenAI endpoint will utilize your OpenAI API key configured in Helicone.
A Deep-Dive of the Moderation Process
A Deep-Dive of the Moderation Process
- Activation: When
Helicone-Moderations-Enabled
is true and the provider is OpenAI, the user’s latest message is prepared for moderation before any chat completion request. - Moderation Check: Our proxy sends the message to the OpenAI Moderation endpoint to assess its content.
- Flag Evaluation: If the moderation endpoint flags the message as inappropriate or harmful, an error response is generated.
Error Repsonse
If the message is flagged, the response will have a400 status code
. It’s crucial to handle this response appropriately.
If the message is not flagged, the proxy forwards it to the chat completion endpoint, and the process continues as normal.
Here’s an example of the error response when flagged:
Coming Soon
We’re continually expanding our moderation features. Upcoming updates include:- Customizable moderation criteria
Need more help?
Need more help?
Additional questions or feedback? Reach out to
help@helicone.ai or schedule a
call with us.