Spaces:
Sleeping
Sleeping
Download clat_ai/test_api.py from ashutoshneemval/CLAT_Guide: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/spaces/ashutoshneemval/CLAT_Guide/resolve/main/clat_ai/test_api.py
- Command line
-
hf download hf://spaces/ashutoshneemval/CLAT_Guide/clat_ai/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/ashutoshneemval/CLAT_Guide/resolve/main/clat_ai/test_api.py
375 Bytes
| import requests | |
| import json | |
| url = "http://127.0.0.1:8000/chat/message" | |
| data = {"message": "What is the CLAT exam?"} | |
| headers = {"Content-Type": "application/json"} | |
| try: | |
| response = requests.post(url, json=data, headers=headers) | |
| print(f"Status Code: {response.status_code}") | |
| print(f"Response Body: {response.text}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |