This project is a simple AI bot interface built with React, utilizing Framer Motion for animations and Tailwind CSS for styling. The interface includes a theme toggle button, a chat component with user and AI messages, and a custom toggle button.
Clone the Repository:
git clone https://github.com/Amanbig/Medical-chat-bot.git
Navigate to the project directory:
cd Medical-chat-bot
Install dependencies:
npm install
Run the app:
npm run dev
Updating the backend endpoint and response in Component 'Userbar.jsx':
const handlePredict = async () => {
try {
const response = await axios.post('http://localhost:5000/predicts', { value }); // put the endpoint of the backend here
setChats(prevChats => [...prevChats, { value: response.data.prediction, from: 'ai' }]); // a json reponse should be there {'prediction':'value'} so response.data.prediction is written here accordingly update
console.log(response.data);
} catch (error) {
console.error('Error:', error);
}
};