716 B
716 B
QuantFortune Chatbot Widget
Overview
- Frontend-only chat widget with deterministic replies.
- Uses a fixed Q&A map in
src/components/chat/qaMap.ts. - No backend or AI calls.
How to extend later with AI
- Replace
matchAnswer()inqaMap.tswith a backend call. - Keep
outOfScopeAnsweras a fallback. - Add streaming responses if needed (SSE / WebSocket).
- Store chat history server-side if needed.
Files
src/components/chat/ChatWidget.tsxsrc/components/chat/ChatButton.tsxsrc/components/chat/MessageBubble.tsxsrc/components/chat/qaMap.ts
Notes
- Suggested question chips are derived from the Q&A map.
- Exact match or keyword match only.
- Typing delay is simulated (500–800ms).