Skip to content

Commit 8e7ead0

Browse files
authored
return False when pred_sequence length and ref_requence length is dif… (#1894)
This pull request is related to issue #1893
1 parent 3237d50 commit 8e7ead0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ragas/metrics/_tool_call_accuracy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ async def _get_arg_score(
5555
def is_sequence_aligned(
5656
self, pred_sequence: t.List[str], ref_sequence: t.List[str]
5757
) -> bool:
58+
if len(pred_sequence) != len(ref_sequence):
59+
return False
5860
ref_index = 0 # Index to track position in reference sequence
5961
for pred in pred_sequence:
6062
if ref_index < len(ref_sequence) and pred == ref_sequence[ref_index]:

0 commit comments

Comments
 (0)