mirror of
https://github.com/katanemo/plano.git
synced 2026-06-02 14:35:14 +02:00
move demo functions out of model_server (#67)
* pending * remove * fix docker build
This commit is contained in:
parent
ca5c9e4824
commit
31f26ef7ac
9 changed files with 122 additions and 50 deletions
|
|
@ -127,32 +127,6 @@ async def zeroshot(req: ZeroShotRequest, res: Response):
|
|||
}
|
||||
|
||||
|
||||
class WeatherRequest(BaseModel):
|
||||
city: str
|
||||
|
||||
|
||||
@app.post("/weather")
|
||||
async def weather(req: WeatherRequest, res: Response):
|
||||
|
||||
weather_forecast = {
|
||||
"city": req.city,
|
||||
"temperature": [],
|
||||
"unit": "F",
|
||||
}
|
||||
for i in range(7):
|
||||
min_temp = random.randrange(50,90)
|
||||
max_temp = random.randrange(min_temp+5, min_temp+20)
|
||||
weather_forecast["temperature"].append({
|
||||
"date": str(date.today() + timedelta(days=i)),
|
||||
"temperature": {
|
||||
"min": min_temp,
|
||||
"max": max_temp
|
||||
}
|
||||
})
|
||||
|
||||
return weather_forecast
|
||||
|
||||
|
||||
'''
|
||||
*****
|
||||
Adding new functions to test the usecases - Sampreeth
|
||||
|
|
@ -309,21 +283,6 @@ async def interface_down_packet_drop(req: PacketDropCorrelationRequest, res: Res
|
|||
logger.info(f"Correlated Packet Drop Data: {correlated_data}")
|
||||
|
||||
return correlated_data.to_dict(orient='records')
|
||||
class InsuranceClaimDetailsRequest(BaseModel):
|
||||
policy_number: str
|
||||
|
||||
@app.post("/insurance_claim_details")
|
||||
async def insurance_claim_details(req: InsuranceClaimDetailsRequest, res: Response):
|
||||
|
||||
claim_details = {
|
||||
"policy_number": req.policy_number,
|
||||
"claim_status": "Approved",
|
||||
"claim_amount": random.randrange(1000, 10000),
|
||||
"claim_date": str(date.today() - timedelta(days=random.randrange(1, 30))),
|
||||
"claim_reason": "Car Accident",
|
||||
}
|
||||
|
||||
return claim_details
|
||||
|
||||
|
||||
class FlowPacketErrorCorrelationRequest(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue