Akhar AI is an intelligent chatbot powered by the ChatGPT API key to generate responses based on natural language inputs.
- Code Snippet Handling: Akhar AI can handle code snippets intelligently, displaying them in a formatted code box for easy reading and copying.
- User-Friendly Interface: The chatbot interface is user-friendly, allowing users to type messages, press Enter to send, and receive responses in real-time.
- Copy Code Functionality: Users can easily copy code snippets displayed by the chatbot with a click of a button.
- Next Line and Clickable links Handling: Akhar AI effectively manages line breaks (\n) and clickable links within messages, ensuring a smooth and user-friendly chat interface.
- Usage as a Node.js Chatbot (Terminal): Akhar AI can also be used as a Node.js chatbot in the terminal. Simply install the dependencies using
npm install
and start the chatbot after adding your API_KEY in .env withnode index.js
. You can then enter messages in the terminal and receive responses from Akhar AI.
To use Akhar AI chatbot in a web interface:
- Enter your message in the input field.
- Press Enter or click the Send button to send your message.
- The chatbot will process your message using the ChatGPT API key and provide a response.
- If the response includes a code snippet, it will be displayed in a formatted code box with a copy icon. Click the copy icon to copy the code snippet to your clipboard.
To use Akhar AI chatbot as a Node.js chatbot in the terminal:
- Clone the repository to your local machine.
- Navigate to the (
backend
) directory. - Create a
.env
file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
- Install dependencies using
npm install
. - Start the chatbot in the terminal using
node index.js
. - Enter your messages in the terminal and press Enter to send.
- The chatbot will process your messages using the ChatGPT API key and provide responses.
- React: Frontend development and user interface.
- Chakra UI: Styling and UI components.
- Axios: HTTP client for making API requests.
- Node.js: Backend server for handling chatbot requests.
- Express.js: Framework for building the backend server.
- ChatGPT API Key: Integration for generating dynamic responses.
- Clone the repository to your local machine.
- Navigate to the (
backend
) directory. - Create a
.env
file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
- Navigate to the backend directory using (
cd backend
) in your terminal. - Install backend dependencies using
npm install
. - Start the backend server using
node server.js
. - Navigate to the project's (
frontend
) directory. - Install frontend dependencies using
npm install
. - Start the development server for the frontend using
npm start
. - Access the chatbot interface in your web browser at
http://localhost:3000
.
This setup ensures that your OpenAI API key is securely stored in the .env file and used by the backend server to interact with the ChatGPT API. Make sure to replace your_openai_api_key_here
with your actual OpenAI API key.