Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -661,6 +661,27 @@ async def followup_agent(query: FollowupQueryModel, background_tasks: Background
|
|
661 |
|
662 |
return StreamingResponse(process_response(), media_type="text/event-stream")
|
663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
if __name__ == "__main__":
|
665 |
import uvicorn
|
666 |
logger.info("Starting the application")
|
|
|
661 |
|
662 |
return StreamingResponse(process_response(), media_type="text/event-stream")
|
663 |
|
664 |
+
from fastapi.middleware.cors import CORSMiddleware
|
665 |
+
# CORS middleware setup
|
666 |
+
app.add_middleware(
|
667 |
+
CORSMiddleware,
|
668 |
+
allow_origins=[
|
669 |
+
"http://localhost:3000",
|
670 |
+
"https://elevaticsai.com",
|
671 |
+
"http://elevaticsai.com",
|
672 |
+
"https://elevatics.cloud",
|
673 |
+
"http://elevatics.cloud",
|
674 |
+
"https://elevatics.online",
|
675 |
+
"http://elevatics.online",
|
676 |
+
"https://elevatics.ai",
|
677 |
+
"http://elevatics.ai",
|
678 |
+
"https://pvanand-specialized-agents.hf.space"
|
679 |
+
],
|
680 |
+
allow_credentials=True,
|
681 |
+
allow_methods=["GET", "POST"],
|
682 |
+
allow_headers=["*"],
|
683 |
+
)
|
684 |
+
|
685 |
if __name__ == "__main__":
|
686 |
import uvicorn
|
687 |
logger.info("Starting the application")
|