-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathmain_api.py
More file actions
35 lines (26 loc) · 827 Bytes
/
main_api.py
File metadata and controls
35 lines (26 loc) · 827 Bytes
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
import logging
import dotenv
from interfaces.api import FlaskAgent
# Set up logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)
def main():
"""
Main entry point for the Heuman Agent Framework.
Runs the Flask API agent.
NOT FOR PRODUCTION
"""
try:
# Load environment variables
dotenv.load_dotenv()
# Initialize and run Flask agent
logger.info("Starting Flask API agent...")
flask_agent = FlaskAgent()
flask_agent.run(host="0.0.0.0", port=5005)
except KeyboardInterrupt:
logger.info("Application stopped by user")
except Exception as e:
logger.error(f"Fatal error: {str(e)}")
raise
if __name__ == "__main__":
main()