Skip to content

Commit

Permalink
fix: agent goal accuracy (#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahules786 authored Oct 25, 2024
1 parent 6d114e5 commit 6cf972c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/concepts/metrics/available_metrics/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ sample = MultiTurnSample(
)

scorer = ToolCallAccuracy()
scorer.llm = your_llm
await scorer.multi_turn_ascore(sample)
```

Expand Down Expand Up @@ -146,7 +147,8 @@ sample = MultiTurnSample(user_input=[
reference="Table booked at one of the chinese restaurants at 8 pm")

scorer = AgentGoalAccuracyWithReference()
await metric.multi_turn_ascore(sample)
scorer.llm = your_llm
await scorer.multi_turn_ascore(sample)

```

Expand Down
6 changes: 6 additions & 0 deletions src/ragas/metrics/_goal_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class AgentGoalAccuracyWithReference(MetricWithLLM, MultiTurnMetric):
)
max_retries: int = 1

async def _ascore(self, row: t.Dict, callbacks: Callbacks) -> float:
raise NotImplementedError

async def _multi_turn_ascore(
self,
sample: MultiTurnSample,
Expand Down Expand Up @@ -153,6 +156,9 @@ class AgentGoalAccuracyWithoutReference(MetricWithLLM, MultiTurnMetric):
)
max_retries: int = 1

async def _ascore(self, row: t.Dict, callbacks: Callbacks) -> float:
raise NotImplementedError

async def _multi_turn_ascore(
self,
sample: MultiTurnSample,
Expand Down

0 comments on commit 6cf972c

Please sign in to comment.