from typing import Any, Optional from smolagents.tools import Tool import requests class OrbitalComputeTool(Tool): name = "orbital_compute_tracker" description = "Orbitwren by CyberMax: every public orbital data center / space AI-compute project (company, hardware, launch date, status, public funding, sources), or the next orbital-compute launch with what is on board. Free tier 100 calls a day, no key; paid keys at https://orbitwren.cybermax-tools.workers.dev/docs" inputs = {'what': {'type': 'string', 'description': "'projects' for the tracked projects or 'next' for the next orbital-compute launch"}} output_type = "object" def forward(self, what: str): import requests path = "next" if what.strip().lower().startswith("next") else "projects" r = requests.get("https://orbitwren.cybermax-tools.workers.dev/api/" + path, params={"via": "smolagents"}, timeout=30) return r.json() def __init__(self, *args, **kwargs): self.is_initialized = False