fastlane / routes /customer_support.py
Hugo Guarin
Update space
c169262
raw
history blame
782 Bytes
from fastapi import APIRouter
from models.query import Query
from services.nlp import generate_response
router = APIRouter()
@router.post("/get-help")
def handle_get_help(query: Query):
response_text = generate_response(
{"query": query.text, "intent": "Get help"})
return {"response": response_text[0]['generated_text']}
@router.get("/return-exchange-policy")
def handle_return_exchange_policy():
return {"policy": "Our return/exchange policy details go here"}
@router.get("/payment-options")
def handle_payment_options():
return {"payment_options": ["Credit Card", "PayPal", "Bank Transfer"]}
@router.get("/shipping-information")
def handle_shipping_information():
return {"shipping_info": "Shipping costs and delivery times details go here"}