Skip to content

Commit

Permalink
Udpated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
penguine-ip committed Nov 27, 2024
1 parent 878dd0d commit d33d5f0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/docs/metrics-json-correctness.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ To use the `JsonCorrectnessMetric`, you'll have to provide the following argumen

## Example

First define your schema by creating a `pydantic` `BaseModel`:

```python
from pydantic import BaseModel

class ExampleSchema(BaseModel):
name: str
```

Then supply it as the `expected_schema` when creating a `JsonCorrectnessMetric`:

```python
from deepeval import evaluate
from deepeval.metrics import JsonCorrectnessMetric
from deepeval.test_case import LLMTestCase

class ExampleSchema(BaseModel):
name: str

metric = JsonCorrectnessMetric(
expected_schema=ExampleSchema,
Expand Down

0 comments on commit d33d5f0

Please sign in to comment.