Spaces:
Runtime error
Runtime error
Commit ·
191e833
1
Parent(s): d9c4778
fix: app.py
Browse files2 unmodified lines34567891011121314151617101819202122186 unmodified lines2092102112032042052062072122132142 unmodified linesfrom typing import List, Dict, Optionalimport asynciofrom main import WebScrapingOrchestratorfrom contextlib import asynccontextmanager
@asynccontextmanagerasync def lifespan(app: FastAPI): # Startup code (if any) goes here yield # Shutdown code goes here await orchestrator.close_connections()
app = FastAPI( title="Advanced Web Scraper for LLM", description="Scrape, analyze, and store web content optimized for LLM consumption", version="1.0.0" version="1.0.0", lifespan = lifespan,)
# Global orchestrator instance186 unmodified lines else: return "advanced"
@app.on_event("shutdown")async def shutdown_event(): """Clean up on shutdown""" orchestrator.close_connections()
# Run the APIif __name__ == "__main__": import uvicornapp.py+10-6