Skip to content

Commit 7437cb2

Browse files
AAgnihotryclaude
andcommitted
feat: add legacy csv evaluator
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>
1 parent b9bcaab commit 7437cb2

15 files changed

Lines changed: 3010 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "2.0",
3+
"resources": []
4+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"$schema": "https://cloud.uipath.com/draft/2024-12/entry-point",
3+
"$id": "entry-points.json",
4+
"entryPoints": [
5+
{
6+
"filePath": "main",
7+
"uniqueId": "d3fdfadf-469d-408a-89bb-9f3202467632",
8+
"type": "function",
9+
"input": {
10+
"type": "object",
11+
"properties": {
12+
"department": {
13+
"title": "Department",
14+
"type": "string"
15+
},
16+
"count": {
17+
"default": 3,
18+
"title": "Count",
19+
"type": "integer"
20+
}
21+
},
22+
"required": [
23+
"department"
24+
],
25+
"title": "Input"
26+
},
27+
"output": {
28+
"type": "object",
29+
"properties": {
30+
"csv_data": {
31+
"title": "Csv Data",
32+
"type": "string"
33+
}
34+
},
35+
"required": [
36+
"csv_data"
37+
],
38+
"title": "Output"
39+
},
40+
"graph": {
41+
"nodes": [
42+
{
43+
"id": "main.py:72",
44+
"name": "main",
45+
"type": "function",
46+
"metadata": {
47+
"file": "main.py"
48+
}
49+
}
50+
],
51+
"edges": []
52+
}
53+
}
54+
]
55+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"id": "employee-csv-eval",
3+
"name": "Employee CSV Generator Evaluation",
4+
"description": "Tests the CSV employee generator agent with various scenarios",
5+
"fileName": "employee_csv_eval_set.json",
6+
"createdAt": "2025-01-01T00:00:00Z",
7+
"updatedAt": "2025-01-01T00:00:00Z",
8+
"evaluatorRefs": [
9+
"csv-name-match",
10+
"csv-name-age-match",
11+
"csv-line-by-line-name"
12+
],
13+
"evaluations": [
14+
{
15+
"id": "eng-3-name-only",
16+
"name": "Engineering - 3 employees - Name only",
17+
"inputs": {
18+
"department": "Engineering",
19+
"count": 3
20+
},
21+
"expectedOutput": {
22+
"csv_data": "Name,Age,Role\nAlice Johnson,28,Software Engineer\nBob Smith,32,Senior Engineer\nCarol Davis,26,DevOps Engineer"
23+
},
24+
"evaluationCriterias": {
25+
"csv-name-match": null,
26+
"csv-name-age-match": null,
27+
"csv-line-by-line-name": null
28+
},
29+
"evalSetId": "employee-csv-eval",
30+
"createdAt": "2025-01-01T00:00:00Z",
31+
"updatedAt": "2025-01-01T00:00:00Z"
32+
},
33+
{
34+
"id": "eng-3-name-age",
35+
"name": "Engineering - 3 employees - Name and Age",
36+
"inputs": {
37+
"department": "Engineering",
38+
"count": 3
39+
},
40+
"expectedOutput": {
41+
"csv_data": "Name,Age,Role\nAlice Johnson,28,Software Engineer\nBob Smith,32,Senior Engineer\nCarol Davis,26,DevOps Engineer"
42+
},
43+
"evaluationCriterias": {
44+
"csv-name-match": null,
45+
"csv-name-age-match": null,
46+
"csv-line-by-line-name": null
47+
},
48+
"evalSetId": "employee-csv-eval",
49+
"createdAt": "2025-01-01T00:00:00Z",
50+
"updatedAt": "2025-01-01T00:00:00Z"
51+
},
52+
{
53+
"id": "sales-2-name-age",
54+
"name": "Sales - 2 employees - Name and Age",
55+
"inputs": {
56+
"department": "Sales",
57+
"count": 2
58+
},
59+
"expectedOutput": {
60+
"csv_data": "Name,Age,Role\nFrank Brown,30,Sales Rep\nGrace Lee,27,Account Manager"
61+
},
62+
"evaluationCriterias": {
63+
"csv-name-match": null,
64+
"csv-name-age-match": null,
65+
"csv-line-by-line-name": null
66+
},
67+
"evalSetId": "employee-csv-eval",
68+
"createdAt": "2025-01-01T00:00:00Z",
69+
"updatedAt": "2025-01-01T00:00:00Z"
70+
},
71+
{
72+
"id": "hr-2-line-by-line",
73+
"name": "HR - 2 employees - Line by line Name check",
74+
"inputs": {
75+
"department": "HR",
76+
"count": 2
77+
},
78+
"expectedOutput": {
79+
"csv_data": "Name,Age,Role\nKelly White,34,HR Manager\nLiam Garcia,28,Recruiter"
80+
},
81+
"evaluationCriterias": {
82+
"csv-name-match": null,
83+
"csv-name-age-match": null,
84+
"csv-line-by-line-name": null
85+
},
86+
"evalSetId": "employee-csv-eval",
87+
"createdAt": "2025-01-01T00:00:00Z",
88+
"updatedAt": "2025-01-01T00:00:00Z"
89+
},
90+
{
91+
"id": "eng-wrong-name-fail",
92+
"name": "Engineering - Wrong name (should fail)",
93+
"inputs": {
94+
"department": "Engineering",
95+
"count": 3
96+
},
97+
"expectedOutput": {
98+
"csv_data": "Name,Age,Role\nWrong Name,28,Software Engineer\nBob Smith,32,Senior Engineer\nCarol Davis,26,DevOps Engineer"
99+
},
100+
"evaluationCriterias": {
101+
"csv-name-match": null,
102+
"csv-name-age-match": null,
103+
"csv-line-by-line-name": null
104+
},
105+
"evalSetId": "employee-csv-eval",
106+
"createdAt": "2025-01-01T00:00:00Z",
107+
"updatedAt": "2025-01-01T00:00:00Z"
108+
},
109+
{
110+
"id": "eng-partial-match",
111+
"name": "Engineering - Line by line with partial match",
112+
"inputs": {
113+
"department": "Engineering",
114+
"count": 3
115+
},
116+
"expectedOutput": {
117+
"csv_data": "Name,Age,Role\nAlice Johnson,28,Software Engineer\nWrong Name,32,Senior Engineer\nCarol Davis,26,DevOps Engineer"
118+
},
119+
"evaluationCriterias": {
120+
"csv-name-match": null,
121+
"csv-name-age-match": null,
122+
"csv-line-by-line-name": null
123+
},
124+
"evalSetId": "employee-csv-eval",
125+
"createdAt": "2025-01-01T00:00:00Z",
126+
"updatedAt": "2025-01-01T00:00:00Z"
127+
}
128+
],
129+
"modelSettings": []
130+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"fileName": "csv_line_by_line_name.json",
3+
"id": "csv-line-by-line-name",
4+
"name": "CSV Line-by-Line Name Match",
5+
"description": "Checks if Name column matches for each row in the CSV output",
6+
"category": 0,
7+
"type": 10,
8+
"targetSubOutputKey": "Name",
9+
"targetOutputKey": "csv_data",
10+
"lineByLineEvaluation": true,
11+
"lineDelimiter": "\n",
12+
"createdAt": "2025-01-01T00:00:00Z",
13+
"updatedAt": "2025-01-01T00:00:00Z"
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"fileName": "csv_name_age_match.json",
3+
"id": "csv-name-age-match",
4+
"name": "CSV Name and Age Match",
5+
"description": "Checks if Name and Age columns match in the CSV output",
6+
"category": 0,
7+
"type": 10,
8+
"targetSubOutputKey": "Name,Age",
9+
"targetOutputKey": "csv_data",
10+
"createdAt": "2025-01-01T00:00:00Z",
11+
"updatedAt": "2025-01-01T00:00:00Z"
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"fileName": "csv_name_match.json",
3+
"id": "csv-name-match",
4+
"name": "CSV Name Column Match",
5+
"description": "Checks if the Name column matches in the CSV output",
6+
"category": 0,
7+
"type": 10,
8+
"targetSubOutputKey": "Name",
9+
"targetOutputKey": "csv_data",
10+
"createdAt": "2025-01-01T00:00:00Z",
11+
"updatedAt": "2025-01-01T00:00:00Z"
12+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""CSV Employee Generator Agent.
2+
3+
This agent generates employee data in CSV format based on the department and count.
4+
"""
5+
6+
from pydantic import BaseModel
7+
8+
9+
class Input(BaseModel):
10+
"""Input schema for employee generation."""
11+
12+
department: str
13+
count: int = 3
14+
15+
16+
class Output(BaseModel):
17+
"""Output schema with CSV data."""
18+
19+
csv_data: str
20+
21+
22+
def main(input: Input) -> Output:
23+
"""Generate employee CSV data based on department and count.
24+
25+
Args:
26+
input: Request with department and count
27+
28+
Returns:
29+
Output with CSV formatted employee data
30+
"""
31+
# Employee database by department
32+
employees_by_dept = {
33+
"Engineering": [
34+
("Alice Johnson", 28, "Software Engineer"),
35+
("Bob Smith", 32, "Senior Engineer"),
36+
("Carol Davis", 26, "DevOps Engineer"),
37+
("David Wilson", 35, "Tech Lead"),
38+
("Eve Martinez", 29, "QA Engineer"),
39+
],
40+
"Sales": [
41+
("Frank Brown", 30, "Sales Rep"),
42+
("Grace Lee", 27, "Account Manager"),
43+
("Henry Taylor", 33, "Sales Director"),
44+
("Ivy Chen", 25, "Sales Associate"),
45+
("Jack Kumar", 31, "Regional Manager"),
46+
],
47+
"HR": [
48+
("Kelly White", 34, "HR Manager"),
49+
("Liam Garcia", 28, "Recruiter"),
50+
("Maya Patel", 29, "HR Specialist"),
51+
("Noah Johnson", 32, "Training Coordinator"),
52+
("Olivia Rodriguez", 26, "HR Assistant"),
53+
],
54+
}
55+
56+
# Get employees for the requested department
57+
department = input.department
58+
count = min(input.count, 5) # Max 5 employees per department
59+
60+
if department not in employees_by_dept:
61+
# Return empty result for unknown department
62+
csv_lines = ["Name,Age,Role"]
63+
return Output(csv_data="\n".join(csv_lines))
64+
65+
employees = employees_by_dept[department][:count]
66+
67+
# Generate CSV
68+
csv_lines = ["Name,Age,Role"]
69+
for name, age, role in employees:
70+
csv_lines.append(f"{name},{age},{role}")
71+
72+
return Output(csv_data="\n".join(csv_lines))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[project]
2+
name = "csv-employee-generator"
3+
version = "0.0.1"
4+
description = "csv-employee-generator"
5+
authors = [{ name = "John Doe", email = "john.doe@myemail.com" }]
6+
dependencies = [
7+
"uipath"
8+
]
9+
requires-python = ">=3.11"
10+
11+
[tool.uv.sources]
12+
uipath = { path = "../..", editable = true }
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
3+
"runtimeOptions": {
4+
"isConversational": false
5+
},
6+
"packOptions": {
7+
"fileExtensionsIncluded": [],
8+
"filesIncluded": [],
9+
"filesExcluded": [],
10+
"directoriesExcluded": [],
11+
"includeUvLock": true
12+
},
13+
"functions": {
14+
"main": "main.py:main"
15+
},
16+
"agents": {}
17+
}

0 commit comments

Comments
 (0)