Spaces:
No application file

File size: 1,024 Bytes
448e111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

import requests

def test_grader():
    url = "http://localhost:8001/grader"
    payload = {
        "task_id": "task_easy_faq",
        "episode_data": {
            "trajectory": [
                {"action": {"action_type": "classify", "content": "billing"}, "reward": 0.25},
                {"action": {"action_type": "respond", "content": "I can help with that."}, "reward": 0.3},
                {"action": {"action_type": "resolve", "content": "Closed."}, "reward": 0.4}
            ],
            "difficulty": "easy",
            "is_resolved": True,
            "classification_correct": True,
            "escalation_correct": True,
            "total_steps": 3,
            "max_steps": 5
        }
    }
    
    print(f"Sending request to {url}...")
    response = requests.post(url, json=payload)
    print(f"Status Code: {response.status_code}")
    try:
        print(f"Response: {response.json()}")
    except:
        print(f"Response text: {response.text}")

if __name__ == "__main__":
    test_grader()