from fastapi import FastAPI from pydantic import BaseModel from chat_qwen import get_response app = FastAPI() # Request model class Prompt(BaseModel): text: str # Route to sum two numbers @app.post("/chat") async def calculate_sum(prompt: Prompt): result = get_response(prompt.text) return {"ask": prompt.text, "answer": result}