Send a request and get the response.
(url, headers, data)
| 197 | # ================= NON-STREAMING TESTS ================= |
| 198 | |
| 199 | def get_response(url, headers, data): |
| 200 | """Send a request and get the response.""" |
| 201 | start_time = time.time() |
| 202 | response = httpx.post(url, headers=headers, json=data, timeout=30) |
| 203 | elapsed = time.time() - start_time |
| 204 | |
| 205 | print(f"Response time: {elapsed:.2f} seconds") |
| 206 | return response |
| 207 | |
| 208 | def compare_responses(anthropic_response, proxy_response, check_tools=False): |
| 209 | """Compare the two responses to see if they're similar enough.""" |