This is a simple chatbot application that uses gpt-3.5-turbo-0613
to interact with users and a weather API to provide real-time weather data.
Before running this code, make sure you have the following prerequisites:
- Node.js installed (version 14 or higher)
- OpenAI API key
- Weather API key (used for the actual weather data)
- Real-time messaging with Socket.IO
- Conversation history management
- Real-time weather data fetch
Before you begin, make sure you have Node.js installed on your system.
- Clone this repository:
git clone https://github.com/your-repo-url
- Install the necessary dependencies:
cd your-project-folder
npm install
- Create a .env file in your root directory and add your OpenAI API Key and Weather API Key:
OPENAI_API_KEY=your_openai_api_key
WEATHER_API_KEY=your_weather_api_key
- Start the application:
npm start
Then, navigate to http://localhost:3000/ in your browser to use the chatbot.
Send a message to the chatbot using the input field at the bottom of the page. You can ask the bot about the weather in any location.
Contributions, issues, and feature requests are welcome!
This project is licensed under the terms of the MIT license.