Spaces:
Sleeping
Sleeping
Commit ·
adbe673
1
Parent(s): bdae06b
Deploy FastAPI chatbot with multi-mode endpoints
Browse files13 unmodified lines14151617181920212223242535 unmodified lines6162636465666712 unmodified lines8081828384858623 unmodified lines11011111211311411511622 unmodified lines13914014114214314414526 unmodified lines17217317417517617717813 unmodified lines# DisclaimerDISCLAIMER = """---The chat interface is built by MD Saib Hossain.For building chat interfaces, Agentic AI systems, or RAG-based chatbots, please contact:https://www.linkedin.com/in/saib-hossain-182834229/"""# Request Model35 unmodified lines# -----------------------------# Default Chat Endpoint# -----------------------------@app.post("/chat")async def general_chat(req: ChatRequest):system_prompt = """12 unmodified lines# -----------------------------# English Endpoint# -----------------------------@app.post("/english")async def english_chat(req: ChatRequest):system_prompt = """23 unmodified lines# -----------------------------# Bangla Endpoint# -----------------------------@app.post("/bangla")async def bangla_chat(req: ChatRequest):system_prompt = """22 unmodified lines# -----------------------------# Math Endpoint# -----------------------------@app.post("/math")async def math_chat(req: ChatRequest):system_prompt = """26 unmodified lines# -----------------------------# Physics Endpoint# -----------------------------@app.post("/physics")async def physics_chat(req: ChatRequest):system_prompt = """13 unmodified lines141516171819202122232425262728293031323334353637383940414243444546474835 unmodified lines8485868788899012 unmodified lines10310410510610710810923 unmodified lines13313413513613713813922 unmodified lines16216316416516616716826 unmodified lines19519619719819920020113 unmodified lines# DisclaimerDISCLAIMER = """<div style="text-align: center; font-size: 0.9em; color: #666; margin-bottom: 20px;"><strong>⚠️ AI Study Assistant Notice</strong><br>This AI chatbot is here to help you study and learn! However, AI can sometimes make mistakes. Always double-check important facts and deadlines with your teacher or course materials. <br><em>For your privacy, please do not share personal information or student IDs in this chat.</em></div>---### 👨💻 Author**Md Saib Hossain***AI Engineer • AI Safety Researcher • Agentic AI Architect**Designing safe, scalable, and human-centered intelligent systems.*Looking to build custom chat interfaces, educational AI systems, or RAG-based chatbots? Let's connect:<p align="left"><a href="mailto:saibhossain5@gmail.com"><img src="https://img.shields.io/badge/Email-saibhossain5%40gmail.com-red?style=flat&logo=gmail" alt="Email"></a><a href="https://linkedin.com/in/saib-hossain-182834229"><img src="https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=flat&logo=linkedin" alt="LinkedIn"></a><a href="https://github.com/Saibhossain"><img src="https://img.shields.io/badge/GitHub-Profile-black?style=flat&logo=github" alt="GitHub"></a><a href="https://saibhossain.github.io/"><img src="https://img.shields.io/badge/Portfolio-Visit-blue?style=flat&logo=google-chrome" alt="Portfolio"></a></p>"""# Request Model35 unmodified lines# -----------------------------# Default Chat Endpoint# -----------------------------@app.post("/api/chat")async def general_chat(req: ChatRequest):system_prompt = """12 unmodified lines# -----------------------------# English Endpoint# -----------------------------@app.post("/api/english")async def english_chat(req: ChatRequest):system_prompt = """23 unmodified lines# -----------------------------# Bangla Endpoint# -----------------------------@app.post("/api/bangla")async def bangla_chat(req: ChatRequest):system_prompt = """22 unmodified lines# -----------------------------# Math Endpoint# -----------------------------@app.post("/api/math")async def math_chat(req: ChatRequest):system_prompt = """26 unmodified lines# -----------------------------# Physics Endpoint# -----------------------------@app.post("/api/physics")async def physics_chat(req: ChatRequest):system_prompt = """
app.py+31-8