-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_api.py
More file actions
32 lines (27 loc) · 984 Bytes
/
run_api.py
File metadata and controls
32 lines (27 loc) · 984 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
#!/usr/bin/env python3
"""Startup script for the FastAPI server."""
from pathlib import Path
import sys
# Add src to path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root / "src"))
if __name__ == "__main__":
import uvicorn
print("Starting Query Automation Agent FastAPI Server...")
print("API will be available at: http://127.0.0.1:8000")
print("Interactive docs at: http://127.0.0.1:8000/docs")
print("Alternative docs at: http://127.0.0.1:8000/redoc")
print("\nEndpoints:")
print(" GET / - API information")
print(" GET /health - Health check")
print(" POST /query - Process natural language query")
print(" POST /query/validate - Validate query")
print(" GET /schema - Get database schema")
print("\nPress Ctrl+C to stop the server")
uvicorn.run(
"agent_pipeline.api.fastapi_app:app",
host="127.0.0.1",
port=8000,
reload=False,
log_level="info",
)