Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.responses import HTMLResponse
|
3 |
from pydantic import BaseModel
|
|
|
4 |
|
5 |
-
class
|
6 |
-
|
7 |
-
price: float
|
8 |
-
|
9 |
|
10 |
app = FastAPI()
|
11 |
|
@@ -20,6 +19,7 @@ def home():
|
|
20 |
def hello():
|
21 |
return {"hello": "world"}
|
22 |
|
23 |
-
@app.post("/
|
24 |
-
def
|
25 |
-
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.responses import HTMLResponse
|
3 |
from pydantic import BaseModel
|
4 |
+
from fastapi.responses import JSONResponse
|
5 |
|
6 |
+
class Text(BaseModel):
|
7 |
+
content: str = ""
|
|
|
|
|
8 |
|
9 |
app = FastAPI()
|
10 |
|
|
|
19 |
def hello():
|
20 |
return {"hello": "world"}
|
21 |
|
22 |
+
@app.post("/sentiment-analysis")
|
23 |
+
def sentiment_analysis_ep(content: Text = None):
|
24 |
+
content = {"message": "hello world"}
|
25 |
+
return JSONResponse(content=content)
|