Spaces:
Sleeping
Sleeping
File size: 1,061 Bytes
b872fd0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """Client for the API Triage Agent environment.
Implements the EnvClient interface for connecting to the
API Triage environment server over HTTP.
"""
try:
from openenv.core.env_client import EnvClient
class APITriageClient(EnvClient):
"""Client for the API Triage Agent OpenEnv environment."""
pass
except ImportError:
# Fallback if openenv-core not installed locally
class APITriageClient: # type: ignore
"""Stub client for local development without openenv-core."""
def __init__(self, base_url: str = "http://localhost:7860"):
self.base_url = base_url
def reset(self):
import requests
return requests.post(f"{self.base_url}/reset").json()
def step(self, action: str):
import requests
return requests.post(
f"{self.base_url}/step",
json={"action": action}
).json()
def state(self):
import requests
return requests.get(f"{self.base_url}/state").json()
|