-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
answeredπ€ The question has been answered. Will be closed automatically if no new commentsπ€ The question has been answered. Will be closed automatically if no new commentsbugSomething isn't workingSomething isn't workingmodule-metricsthis is part of metrics modulethis is part of metrics module
Description
[ X ] I have checked the documentation and related resources and couldn't resolve my bug.
Describe the bug
Not able to see the reason for ragas score.
Ragas version: 0.3.2
Python version: 3.11.6
Code to Reproduce
for trace in predictions:
# --- build reference
reference = infer_reference(trace["overall_input"])
print("============reference===============")
print(reference)
reference_tool_calls = sorted(
[ToolCall(name=tool, args={}) for tool in reference.get("expected_tools", [])],
key=lambda x: x.name
)
actual_tool_called = sorted(
[ToolCall(name=tool, args={}) for tool in set(trace["tool_calls"])],
key=lambda x: x.name
)
# --- multi-turn sample
sample = MultiTurnSample(
user_input=[
RHMessage(content=trace["overall_input"]),
RAMessage(content=trace["overall_output"], tool_calls=actual_tool_called),
],
reference_tool_calls=reference_tool_calls,
reference=reference["reference"],
reference_topics=[reference["reference_topic"]]
)
# --- single-turn sample
test_data = SingleTurnSample(
user_input=trace["overall_input"],
response=trace["overall_output"]
)
# --- run evaluations
dataset_multi = EvaluationDataset(samples=[sample])
# dataset_single = EvaluationDataset(samples=[test_data])
multi_results = evaluate(dataset=dataset_multi, metrics=multi_turn_metrics)
Error trace
Not getting reason for ragas score.
Expected behavior
Need to see both score and reason
dosubot
Metadata
Metadata
Assignees
Labels
answeredπ€ The question has been answered. Will be closed automatically if no new commentsπ€ The question has been answered. Will be closed automatically if no new commentsbugSomething isn't workingSomething isn't workingmodule-metricsthis is part of metrics modulethis is part of metrics module