Skip to content

Commit

Permalink
wrong model in moderation api
Browse files Browse the repository at this point in the history
  • Loading branch information
tcapelle committed Feb 7, 2025
1 parent 31ccb41 commit 2c26d3e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions docs/docs/guides/evaluation/builtin_scorers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,14 @@ import TabItem from '@theme/TabItem';
```python
from weave.scorers import OpenAIModerationScorer

scorer = OpenAIModerationScorer(
model_id="openai/text-embedding-3-small" # or any other model supported by litellm
)
scorer = OpenAIModerationScorer()
```

**How It Works:**

- Sends the AI's output to the OpenAI Moderation endpoint and returns a structured response indicating if the content is flagged.

**Notes:**

- Requires the `openai` Python package.
- The LLM client is now managed internally.

Here is an example in the context of an evaluation:

```python
Expand All @@ -165,9 +159,7 @@ import TabItem from '@theme/TabItem';
return input

# Initialize scorer
moderation_scorer = OpenAIModerationScorer(
model_id="openai/text-embedding-3-small" # or any other model supported by litellm
)
moderation_scorer = OpenAIModerationScorer()

# Create dataset
dataset = [
Expand Down

0 comments on commit 2c26d3e

Please sign in to comment.