Spaces:
Running
Running
| import asyncio | |
| import httpx | |
| async def main(): | |
| try: | |
| async with httpx.AsyncClient(timeout=30.0) as client: | |
| print("HEALTH...") | |
| resp = await client.get("https://dherain24-claude-proxy.hf.space/health") | |
| print("HEALTH:", resp.status_code, resp.text) | |
| print("Testing auth...") | |
| resp = await client.post( | |
| "https://dherain24-claude-proxy.hf.space/v1/messages", | |
| headers={"x-api-key": "test_token"}, | |
| json={ | |
| "model": "nvidia_nim/nvidia/llama-3.1-nemotron-ultra-253b-v1", | |
| "messages": [{"role": "user", "content": "Hello"}], | |
| "max_tokens": 10 | |
| } | |
| ) | |
| print("MESSAGES STATUS:", resp.status_code) | |
| print("MESSAGES BODY:", resp.text) | |
| except Exception as e: | |
| print("ERROR:", e) | |
| asyncio.run(main()) | |