from fastapi import APIRouter | |
from models.input import Input | |
from services.nlp import generate_response | |
router = APIRouter() | |
def handle_get_help(input: Input): | |
response_text = generate_response( | |
{"query": input.text, "intent": "Get help"}) | |
return {"response": response_text[0]['generated_text']} | |
def handle_return_exchange_policy(): | |
return {"policy": "Our return/exchange policy details go here"} | |
def handle_payment_options(): | |
return {"payment_options": ["Credit Card", "PayPal", "Bank Transfer"]} | |
def handle_shipping_information(): | |
return {"shipping_info": "Shipping costs and delivery times details go here"} | |