diff --git a/fbpcs/smart_agent/__init__.py b/fbpcs/smart_agent/__init__.py deleted file mode 100644 index 4b87eb9e4..000000000 --- a/fbpcs/smart_agent/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. diff --git a/fbpcs/smart_agent/handler.py b/fbpcs/smart_agent/handler.py deleted file mode 100644 index aa9f758c4..000000000 --- a/fbpcs/smart_agent/handler.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# pyre-strict - - -from typing import Dict - -from fastapi import APIRouter - -router = APIRouter() - - -@router.get("/") -def hello_world() -> Dict[str, str]: - return {"message": "Hello World"} diff --git a/fbpcs/smart_agent/server.py b/fbpcs/smart_agent/server.py deleted file mode 100644 index 885cdb3dd..000000000 --- a/fbpcs/smart_agent/server.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# pyre-strict - - -import logging - -from fastapi import FastAPI - -from fbpcs.smart_agent import handler - - -logging.basicConfig(level=logging.INFO) - -app = FastAPI() - -app.include_router(handler.router) - - -def main() -> None: - # uvicorn.run(app, host="0.0.0.0", port=8000) - from multiprocessing import Process - - import uvicorn - - server = Process( - target=uvicorn.run, - args=(app,), - kwargs={ - "host": "0.0.0.0", - "port": 8000, - }, - ) - logging.info("Starting server...") - server.start() - - import time - - for i in range(10): - logging.info(f"Sleeping 1 sec - {i}") - time.sleep(1) - - logging.info("Terminating server...") - server.terminate() - server.join() - - -if __name__ == "__main__": - main() # pragma: no cover