File size: 1,028 Bytes
3abfc90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
import requests
import json

API_URL = "http://localhost:8000/api/v1"

def test_chat():
    # 1. Start Interview
    print("Starting Interview...")
    start_res = requests.post(f"{API_URL}/start", json={
        "target_company": "Google",
        "job_role": "Python Dev",
        "interview_style": "Professional",
        "difficulty": "Medium"
    })
    
    if start_res.status_code != 200:
        print(f"Start failed: {start_res.text}")
        return

    session_id = start_res.json()["session_id"]
    print(f"Session ID: {session_id}")

    # 2. Send Chat Message
    print("Sending Chat Message...")
    chat_payload = {
        "session_id": session_id,
        "text_input": "I have 5 years of experience with Python."
    }
    
    try:
        chat_res = requests.post(f"{API_URL}/chat", data=chat_payload)
        print(f"Status: {chat_res.status_code}")
        print(f"Response: {chat_res.text}")
    except Exception as e:
        print(f"Request Error: {e}")

if __name__ == "__main__":
    test_chat()