Update main.py
Browse files
main.py
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
-
from fastapi import FastAPI, Query
|
| 2 |
-
from pydantic import BaseModel
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
app = FastAPI()
|
| 6 |
-
|
| 7 |
-
# @app.get("/query")
|
| 8 |
-
# def greet_user(query: str = Query(..., description="Enter any string")):
|
| 9 |
-
# return {"message": "Hello! Welcome to SpaarxSense. How can I help you today?"}
|
| 10 |
-
|
| 11 |
-
class QueryInput(BaseModel):
|
| 12 |
-
query: str
|
| 13 |
-
|
| 14 |
-
@app.get("/")
|
| 15 |
-
def root():
|
| 16 |
-
return {"status": "online"}
|
| 17 |
-
|
| 18 |
-
@app.post("/
|
| 19 |
-
def
|
| 20 |
return {"message": "Hello! Welcome to SpaarxSense. How can I help you today?"}
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Query
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
# @app.get("/query")
|
| 8 |
+
# def greet_user(query: str = Query(..., description="Enter any string")):
|
| 9 |
+
# return {"message": "Hello! Welcome to SpaarxSense. How can I help you today?"}
|
| 10 |
+
|
| 11 |
+
class QueryInput(BaseModel):
|
| 12 |
+
query: str
|
| 13 |
+
|
| 14 |
+
@app.get("/")
|
| 15 |
+
def root():
|
| 16 |
+
return {"status": "online"}
|
| 17 |
+
|
| 18 |
+
@app.post("/query")
|
| 19 |
+
def query(input_data: QueryInput):
|
| 20 |
return {"message": "Hello! Welcome to SpaarxSense. How can I help you today?"}
|