Skip to content

Commit 3c00e85

Browse files
hallacyTodor Markov
and
Todor Markov
authored
Add Moderation endpoint to readme (#151) (#138)
* Add Moderation endpoint to readme * add basic example Co-authored-by: Todor Markov <[email protected]>
1 parent dc33cb9 commit 3c00e85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,19 @@ openai wandb sync
193193

194194
For more information on fine tuning, read the [fine-tuning guide](https://beta.openai.com/docs/guides/fine-tuning) in the OpenAI documentation.
195195

196+
### Moderation
197+
198+
OpenAI provides a Moderation endpoint that can be used to check whether content complies with the OpenAI [content policy](https://beta.openai.com/docs/usage-policies)
199+
200+
```python
201+
import openai
202+
openai.api_key = "sk-..." # supply your API key however you choose
203+
204+
moderation_resp = openai.Moderation.create(input="Here is some perfectly innocuous text that follows all OpenAI content policies.")
205+
```
206+
207+
See the [moderation guide](https://beta.openai.com/docs/guides/moderation) for more details.
208+
196209
## Image generation (DALL·E)
197210

198211
```python

0 commit comments

Comments
 (0)