Spaces:
Paused
Paused
Download api_test.py from oma5/fab-yield-agent: direct link, hf CLI and curl.
- Browser
- Download file 968 Bytes
-
https://huggingface.co/spaces/oma5/fab-yield-agent/resolve/main/api_test.py
- Command line
-
hf download hf://spaces/oma5/fab-yield-agent/api_test.py
-
curl -L -o api_test.py https://huggingface.co/spaces/oma5/fab-yield-agent/resolve/main/api_test.py
968 Bytes
| import requests | |
| # ⚠️ Make sure this URL matches your actual Space URL exactly | |
| SPACE_URL = "https://pranjalzetsu-semiconductor-yield-agent.hf.space" | |
| print("--- 1. Testing /reset ---") | |
| reset_res = requests.post(f"{SPACE_URL}/reset", json={"difficulty": 1}) | |
| obs = reset_res.json() | |
| print(f"Active Params: {obs.get('active_params')}") | |
| print(f"Budget Remaining: {obs.get('budget_remaining')}") | |
| print("\n--- 2. Testing /step ---") | |
| dummy_action = { | |
| "params": { | |
| "temp": 190.0, | |
| "etch_time": 60.0, | |
| "pressure": 2.2, | |
| "dopant": 1.4e15, | |
| "spin_speed": 2500.0 | |
| }, | |
| "primary_bottleneck": "temp", | |
| "reasoning": "Verifying API handshake.", | |
| "submit": False | |
| } | |
| step_res = requests.post(f"{SPACE_URL}/step", json=dummy_action) | |
| step_data = step_res.json() | |
| print(f"New Step: {step_data['observation']['step']}") | |
| print(f"Yield Reward: {step_data['rewards']['yield']}") | |
| print(f"Total Reward: {step_data['rewards']['total']}") |