-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_evaluator.py
More file actions
36 lines (28 loc) · 1.05 KB
/
test_evaluator.py
File metadata and controls
36 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
"""Test script to diagnose evaluator issues in CI"""
import sys
import asyncio
sys.path.insert(0, '.')
async def main():
try:
from evaluators.local_evaluator import AgentsDemoEvaluator
print("✅ Evaluator imported successfully")
evaluator = AgentsDemoEvaluator()
print(f"✅ Evaluator instantiated: {evaluator.api_url}")
# Test a simple call
result = await evaluator.evaluate_case(
config_key="test",
test_input="hello",
context_attributes={"test": "value"}
)
print(f"✅ Evaluator call completed: error={result.error is not None}, response_len={len(result.response)}")
if result.error:
print(f" Error details: {result.error[:500]}")
await evaluator.cleanup()
except Exception as e:
import traceback
print(f"❌ Evaluator test FAILED: {type(e).__name__}: {e}")
traceback.print_exc()
sys.exit(1)
if __name__ == "__main__":
asyncio.run(main())