Viani's picture
Fix: add uv.lock, fix app.py main() for openenv validate
170407b verified
raw
history blame contribute delete
874 Bytes
"""FastAPI application for the DataDetective environment."""
try:
from openenv.core.env_server.http_server import create_app
except Exception as e:
raise ImportError(
"openenv-core is required. pip install openenv-core"
) from e
try:
from ..models import DataDetectiveAction, DataDetectiveObservation
from .environment import DataDetectiveEnvironment
except (ImportError, ModuleNotFoundError):
from models import DataDetectiveAction, DataDetectiveObservation
from server.environment import DataDetectiveEnvironment
app = create_app(
DataDetectiveEnvironment,
DataDetectiveAction,
DataDetectiveObservation,
env_name="data_detective",
max_concurrent_envs=10,
)
def main(host: str = "0.0.0.0", port: int = 7860):
import uvicorn
uvicorn.run(app, host=host, port=port)
if __name__ == "__main__":
main()