File size: 850 Bytes
171eb01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import requests
import time

url = "http://127.0.0.1:8000/api/report/"
# Create a large text payload (approx 3000 words)
large_text = "Analysis of complex AI systems requires robust testing. " * 300 

data = {
    "text": large_text,
    "score": 98.5,
    "label": "AI Generated"
}

start_time = time.time()
try:
    print(f"Sending request with {len(large_text)} characters...")
    response = requests.post(url, json=data, timeout=60) # 60s timeout
    duration = time.time() - start_time
    
    if response.status_code == 200:
        print(f"Success! Took {duration:.2f}s")
        with open("repro_large.pdf", "wb") as f:
            f.write(response.content)
    else:
        print(f"Failed: {response.status_code}")
        print(response.text[:1000])

except Exception as e:
    print(f"Error after {time.time() - start_time:.2f}s: {e}")