Skip to content

feat: add legacy csv evaluator#1525

Open
AAgnihotry wants to merge 2 commits intomainfrom
feat/csvColumnMatch
Open

feat: add legacy csv evaluator#1525
AAgnihotry wants to merge 2 commits intomainfrom
feat/csvColumnMatch

Conversation

@AAgnihotry
Copy link
Copy Markdown
Contributor

Summary

Add LegacyCSVExactMatchEvaluator for comparing specific CSV columns in agent evaluation outputs.

Features

Single and multiple column comparison - Compare one or more CSV columns (e.g., "Name" or "Name,Age")
Case-insensitive column name matching - "Name", "NAME", "name" all match
Line-by-line evaluation - Evaluate each CSV row separately with header preservation
Automatic job attachment download - Seamlessly handles attachment URIs via base class
Detailed error messages - Clear feedback for missing columns or invalid CSV format

Implementation Details

New Evaluator

  • File: src/uipath/eval/evaluators/legacy_csv_exact_match_evaluator.py
  • Type: LegacyEvaluatorType.CSVColumnExactMatch (type 10)
  • Config: Uses targetSubOutputKey for column names (comma-separated)
  • Modes:
    • Normal mode: Compares first data row only
    • Line-by-line mode: Evaluates each row separately with aggregation

Key Implementation Features

  1. Base class integration - Uses _get_actual_output() for proper extraction with targetOutputKey
  2. CSV parsing - Uses Python's csv.DictReader for reliable parsing
  3. Line-by-line support - Preserves headers when splitting rows for evaluation
  4. Error handling - Comprehensive validation for missing columns, empty CSV, invalid format

Sample Project

New sample: samples/csv_employee_generator/

  • Agent that generates employee CSV data by department
  • 6 evaluation test cases covering success, failure, and partial match scenarios
  • 3 evaluator configurations (single column, multi-column, line-by-line)
  • Uses BaseModel for Input/Output schemas
  • Configured to use local repository version via [tool.uv.sources]

Test Coverage

All 1702 tests pass including 22 new CSV evaluator tests

  • Single column extraction
  • Multiple column extraction
  • Line-by-line evaluation
  • Job attachment handling
  • Error cases (missing columns, empty CSV, invalid format)

Test Results

Engineering - 3 employees:        100%, 100%, 100% ✅
Sales - 2 employees:              100%, 100%, 100% ✅
HR - 2 employees:                 100%, 100%, 100% ✅
Engineering - Wrong name (fail):    0%,   0%,  67% ✅ (correct failure)
Engineering - Partial match:      100%, 100%,  67% ✅ (2/3 rows match)

Files Changed

Core Implementation:

  • src/uipath/eval/evaluators/legacy_csv_exact_match_evaluator.py (419 lines)
  • tests/cli/evaluators/test_legacy_csv_exact_match_evaluator.py (639 lines)
  • Updated evaluator.py discriminator mapping
  • Updated models.py with new enum value

Sample Project:

  • samples/csv_employee_generator/main.py - CSV generator agent
  • samples/csv_employee_generator/evaluations/ - 3 evaluators, 6 test cases
  • samples/csv_employee_generator/pyproject.toml - Local package dependencies

Breaking Changes

None - This is a new evaluator type.

Related Issues

Implements CSV column comparison evaluator for agent evaluation framework.


🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Mar 27, 2026
Add LegacyCSVExactMatchEvaluator for comparing specific CSV columns with support for:
- Single and multiple column comparison
- Case-insensitive column name matching
- Line-by-line evaluation with header preservation
- Automatic job attachment download
- Sample project demonstrating CSV evaluation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@AAgnihotry AAgnihotry force-pushed the feat/csvColumnMatch branch from 03e8afb to 7437cb2 Compare March 27, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant