|
|
|
@ -21,6 +21,7 @@ import traceback
|
|
|
|
|
from swarms import Agent
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
|
print ("starting")
|
|
|
|
|
# Load environment variables
|
|
|
|
|
load_dotenv()
|
|
|
|
|
|
|
|
|
@ -613,17 +614,25 @@ class SwarmsAPI:
|
|
|
|
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
|
|
|
"""Create and configure the FastAPI application."""
|
|
|
|
|
print("create app")
|
|
|
|
|
api = SwarmsAPI()
|
|
|
|
|
return api.app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
#if __name__ == "__main__":
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
#freeze_support()
|
|
|
|
|
print("yes in main")
|
|
|
|
|
# Configure uvicorn logging
|
|
|
|
|
logger.info("API Starting")
|
|
|
|
|
|
|
|
|
|
uvicorn.run(
|
|
|
|
|
"main:create_app",
|
|
|
|
|
host="0.0.0.0",
|
|
|
|
|
port=8000,
|
|
|
|
|
reload=True,
|
|
|
|
|
workers=4,
|
|
|
|
|
# reload=True,
|
|
|
|
|
# workers=4,
|
|
|
|
|
)
|
|
|
|
|
else:
|
|
|
|
|
print("not in main")
|
|
|
|
|
|