Vishaltiwari2019 commited on
Commit
e0e4a06
·
verified ·
1 Parent(s): f5a3fdf

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +19 -19
main.py CHANGED
@@ -1,19 +1,19 @@
1
- from fastapi import FastAPI, Request
2
- from pydantic import BaseModel
3
- from langgraph_chain import create_graph
4
- from fastapi import Form
5
-
6
- app = FastAPI()
7
- graph = create_graph()
8
-
9
- class Query(BaseModel):
10
- question: str
11
-
12
- @app.get("/")
13
- def read_root():
14
- return {"Hello": "World"}
15
-
16
- @app.post("/ask")
17
- def ask_q(question: str = Form(...)):
18
- result = graph.invoke({"question": question})
19
- return {"response": result}
 
1
+ from fastapi import FastAPI, Request
2
+ from pydantic import BaseModel
3
+ from langgraph_chain import create_graph
4
+ from fastapi import Form
5
+
6
+ app = FastAPI()
7
+ graph = create_graph()
8
+
9
+ class Query(BaseModel):
10
+ question: str
11
+
12
+ @app.get("/")
13
+ def read_root():
14
+ return {"Message": "Welcome To Engineer Astra"}
15
+
16
+ @app.post("/ask")
17
+ def ask_q(question: str = Form(...)):
18
+ result = graph.invoke({"question": question})
19
+ return {"response": result}