openenv/coding_env
21
1# Copyright (c) Meta Platforms, Inc. and affiliates.2# All rights reserved.3#4# This source code is licensed under the BSD-style license found in the5# LICENSE file in the root directory of this source tree.6 7"""8FastAPI application for the Coding Environment.9 10This module creates an HTTP server that exposes the PythonCodeActEnv11over HTTP endpoints, making it compatible with HTTPEnvClient.12 13Usage:14 # Development (with auto-reload):15 uvicorn envs.coding_env.server.app:app --reload --host 0.0.0.0 --port 800016 17 # Production:18 uvicorn envs.coding_env.server.app:app --host 0.0.0.0 --port 8000 --workers 419 20 # Or run directly:21 python -m envs.coding_env.server.app22"""23 24from core.env_server import create_app25 26from ..models import CodeAction, CodeObservation27from .python_codeact_env import PythonCodeActEnv28 29# Create the environment instance30env = PythonCodeActEnv()31 32# Create the app with web interface and README integration33app = create_app(env, CodeAction, CodeObservation, env_name="coding_env")34 35 36if __name__ == "__main__":37 import uvicorn38 39 uvicorn.run(app, host="0.0.0.0", port=8000)40 