pankaj9075rawat commited on
Commit
082e4b0
·
verified ·
1 Parent(s): b4ada1c

Update src/app/app.py

Browse files
Files changed (1) hide show
  1. src/app/app.py +8 -0
src/app/app.py CHANGED
@@ -2,6 +2,7 @@ from llamaLLM import get_init_AI_response, get_response
2
  from fastapi import FastAPI, HTTPException
3
  from pydantic import BaseModel # data validation
4
  from typing import List, Optional, Dict
 
5
 
6
 
7
  # print("entered app.py")
@@ -33,6 +34,13 @@ chat_history: Dict[str, Dict[str, List[Dict[str, str]]]] = {}
33
 
34
  app = FastAPI()
35
 
 
 
 
 
 
 
 
36
 
37
  @app.get("/")
38
  async def read_main():
 
2
  from fastapi import FastAPI, HTTPException
3
  from pydantic import BaseModel # data validation
4
  from typing import List, Optional, Dict
5
+ from fastapi.middleware.cors import CORSMiddleware
6
 
7
 
8
  # print("entered app.py")
 
34
 
35
  app = FastAPI()
36
 
37
+ app.add_middleware(
38
+ CORSMiddleware,
39
+ allow_origins=["*"],
40
+ allow_credentials=True,
41
+
42
+ )
43
+
44
 
45
  @app.get("/")
46
  async def read_main():