From 32fc6a330498fa762c42b6f85514a1eaf470e672 Mon Sep 17 00:00:00 2001 From: Todor Markov Date: Thu, 17 Nov 2022 12:06:57 -0800 Subject: [PATCH] Add Moderation endpoint to readme (#151) * Add Moderation endpoint to readme * add basic example --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 85955bdab2..1dad8c0a96 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,19 @@ openai wandb sync For more information on fine tuning, read the [fine-tuning guide](https://beta.openai.com/docs/guides/fine-tuning) in the OpenAI documentation. +### Moderation + +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) + +```python +import openai +openai.api_key = "sk-..." # supply your API key however you choose + +moderation_resp = openai.Moderation.create(input="Here is some perfectly innocuous text that follows all OpenAI content policies.") +``` + +See the [moderation guide](https://beta.openai.com/docs/guides/moderation) for more details. + ## Image generation (DALLĀ·E) ```python