Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the documentation in the migration docs #1873

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions docs/howtos/migrations/migrate_from_v01_to_v02.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,21 @@ Second is that [`metrics.ascore`][ragas.metrics.base.Metric.ascore] is now being
```python
# create a Single Turn Sample
from ragas import SingleTurnSample

sample = SingleTurnSample(
user_input="user query",
response="response from your pipeline"
user_input="user query",
response="response from your pipeline",
retrieved_contexts=["retrieved", "contexts", "from your pipeline" ]
)

# Init the metric
from ragas.metrics import Faithfulness
faithfulness_metric = Faithfulness(llm=your_evaluator_llm)
score = faithfulness.single_turn_ascore(sample=sample)
print(score)
# 0.9
await faithfulness_metric.single_turn_ascore(sample)
```
Output
```
1
```

## Testset Generation
Expand Down
Loading