Skip to content
Merged
Changes from 1 commit
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
22 changes: 22 additions & 0 deletions eval_protocol/utils/evaluation_row_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import List

from eval_protocol.models import EvaluationRow, Message
from eval_protocol.models import InputMetadata


def serialize_message(msg: Message) -> str:
Expand Down Expand Up @@ -134,3 +135,24 @@ def assistant_to_ground_truth(data: List[EvaluationRow]) -> List[EvaluationRow]:
)

return processed_rows


def create_rows_from_indices(count: int, **metadata) -> List[EvaluationRow]:
"""Create evaluation rows with sequential row_ids.
Useful for remote processors where the server determines content based on row_id.
Args:
count: Number of rows to create
**metadata: Additional metadata to include in each row
Returns:
List of EvaluationRows with row_id set to "0", "1", "2", ...
"""
rows = []
for idx in range(count):
row_metadata = {"row_id": str(idx), **metadata}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Metadata Overrides Sequential Row IDs

The create_rows_from_indices function allows **metadata to override the generated sequential row_id. If **metadata includes a row_id key, it will take precedence, preventing the function from creating the documented sequential IDs ('0', '1', '2', ...).

Fix in Cursor Fix in Web

rows.append(
EvaluationRow(
messages=[],
input_metadata=InputMetadata(**row_metadata),
)
)
return rows
Loading