docs add moderation

This commit is contained in:
ishaan-jaff 2023-09-19 21:47:31 -07:00
parent 744316cdbd
commit 122a457533
3 changed files with 20 additions and 13 deletions

View file

@ -0,0 +1,10 @@
# Moderation
LiteLLM supports the moderation endpoint for OpenAI
## Usage
```python
import os
from litellm import moderation
os.environ['OPENAI_API_KEY'] = ""
response = moderation(input="i'm ishaan cto of litellm")
```

View file

@ -1,5 +1,13 @@
# Embedding Models # Embedding Models
## Usage
```python
from litellm import embedding
import os
os.environ['OPENAI_API_KEY'] = ""
response = embedding('text-embedding-ada-002', input=["good morning from litellm"])
```
## OpenAI Embedding Models ## OpenAI Embedding Models
| Model Name | Function Call | Required OS Variables | | Model Name | Function Call | Required OS Variables |
@ -11,14 +19,3 @@
| Model Name | Function Call | Required OS Variables | | Model Name | Function Call | Required OS Variables |
|----------------------|---------------------------------------------|--------------------------------------| |----------------------|---------------------------------------------|--------------------------------------|
| text-embedding-ada-002 | `embedding('embedding-model-deployment', input=input, custom_llm_provider="azure")` | `os.environ['AZURE_API_KEY']`,`os.environ['AZURE_API_BASE']`,`os.environ['AZURE_API_VERSION']` | | text-embedding-ada-002 | `embedding('embedding-model-deployment', input=input, custom_llm_provider="azure")` | `os.environ['AZURE_API_KEY']`,`os.environ['AZURE_API_BASE']`,`os.environ['AZURE_API_VERSION']` |
# Moderation
LiteLLM supports the moderation endpoint for OpenAI
## Usage
```python
import os
from litellm import moderation
os.environ['OPENAI_API_KEY'] = ""
response = moderation(input="i'm ishaan cto of litellm")
```

View file

@ -42,7 +42,7 @@ const sidebars = {
{ {
type: "category", type: "category",
label: "Embedding() & Moderation()", label: "Embedding() & Moderation()",
items: ["embedding/supported_embedding"], items: ["embedding/supported_embedding", "embedding/moderation"],
}, },
{ {
type: "category", type: "category",