MCPcopy
hub / github.com/Agenta-AI/agenta / _validate_testset_limits

Function _validate_testset_limits

api/oss/src/routers/testset_router.py:61–74  ·  view source on GitHub ↗
(rows: List[dict])

Source from the content-addressed store, hash-verified

59
60
61def _validate_testset_limits(rows: List[dict]) -> tuple[int, int]:
62 total_size = 2
63 for i, row in enumerate(rows):
64 row_str = json.dumps(row)
65 total_size += len(row_str.encode("utf-8"))
66 if i > 0:
67 total_size += 1
68 if i + 1 > TESTSETS_COUNT_LIMIT:
69 log.error(TESTSETS_COUNT_WARNING)
70 raise TESTSETS_COUNT_EXCEPTION
71 if total_size > TESTSETS_SIZE_LIMIT:
72 log.error(TESTSETS_SIZE_WARNING)
73 raise TESTSETS_SIZE_EXCEPTION
74 return i + 1, total_size
75
76
77@router.post(

Callers 4

upload_fileFunction · 0.85
import_testsetFunction · 0.85
create_testsetFunction · 0.85
update_testsetFunction · 0.85

Calls 2

encodeMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected