A simple demonstration of integrating with GenAI in the form of a ChatBot.
- Chat Interface: A text input and scrolling chat view for a conversation.
- Gemini Flash 2.5 Integration: Messages get sent to Gemini 2.5 Flash for responses.
- Chat History: Messages earlier in the conversation are included in the chat.
To run this project locally:
- Clone the repository:
git clone https://github.com/iphswift/hello-world-chat.git - Navigate to the project directory:
cd hello-world-chat - Install any necessary packages:
npm install - Add your API Key to the
.envfile:VITE_GOOGLE_API_KEY=your_api_key_here - Launch the development server:
npm run dev - Navigate to the website in your browser. This should be
http://localhost:5173, but it may be at another address.
That's it! Now you can type in the text box and press enter or click the send arrow button to converse with the AI!
The code is written in a single Vue component (ChatWidget.vue). It uses the @google/genai library to interact with the Gemini Flash 2.5 model. User messages are sent to the model, and the responses are displayed in a chat interface.
- Vue.js 3.5 Frontend framework for building the user interface.
- Vite: Development server and build tool.
- Google GenAI SDK: For interacting with the Gemini Flash 2.5 model.
- Font Awesome: Icons for the chat interface.