Spaces:
Paused
Paused
File size: 762 Bytes
456d207 703e5e6 226a40e c6f40e8 703e5e6 226a40e 703e5e6 226a40e 456d207 703e5e6 456d207 703e5e6 4baab8b 703e5e6 226a40e 4baab8b 226a40e c6f40e8 4baab8b c6f40e8 703e5e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
from fastapi import FastAPI
from pydantic import BaseModel
from calculator import calculate
from sentimentAnalysis import sentimentAnalysis
from customerSupport import customerConverstaion
class User_input(BaseModel):
sentence:str
operation:str
x:float
y:float
app = FastAPI()
@app.get("/hello")
def greet_json():
return {"Hello": "World!"}
@app.post("/calculate")
def calculate_func(input:User_input):
res= calculate(input.operation, input.x, input.y)
return res
@app.post("/sentimentAnalysis")
def sentimentAnalysis_func(input:User_input):
res= sentimentAnalysis(input.sentence)
return res
@app.post("/getReply")
def getReply_func(input:User_input):
res= customerConverstaion(input.sentence)
return res
|