How to add NSFW filter to Completion API?

How to filter violated text in completion api?
how can we add filter?
How can I avoid or filter it/?

You could use Langchain’s Moderation method for it.
Check this out:
https://python.langchain.com/en/latest/modules/chains/examples/moderation.html

In addition to what @iamsaiyan suggested, you can also send the prompt to OpenAI’s moderation API endpoint.

1 Like