A Spring Boot application that provides an AI-powered HTML content generation assistant. This project demonstrates how to integrate AI capabilities with a web interface to generate HTML content based on user-provided prompts, leveraging Spring AI.
The HTML Assistant is a web-based tool that allows users to generate HTML content through an AI-powered interface. The application uses Spring Boot and Spring AI as its backend framework and integrates with Redis for state management. The AI capabilities are provided through a chat client that can be configured to work with different AI providers.
- AI-powered HTML content generation
- User-friendly web interface
- Redis-based state management
- Configurable AI integration
- Responsive design
- Java 21 or higher
- Docker daemon to run Redis on your workstation
- AI API key (e.g., Mistral AI)
-
Clone the repository:
git clone https://github.com/your-username/html-assistant.git
-
Build the project using Maven:
cd html-assistant ./mvnw clean package
-
Configure AI API keys (see Configuration section below).
-
Run the application:
./mvnw spring-boot:run -Dspring-boot.run.profiles=<AI profile, see below>
The application has been tested with Mistral AI, DeepSeek, Gemma, and Llama. DeepSeek, Gemma and Llama are provided through Groq Cloud and its OpenAI compatible endpoint.
Mistral AI is used by default: just set environment variable MISTRALAI_API_KEY
.
For other AI models, you need a Groq API key, defined by the environment variable GROQ_API_KEY
.
Depending on the AI model you want to run, you need to enable the according Spring profile:
- DeepSeek:
deepseek
- Gemma:
gemma
- Llama:
llama
For instance, run this app with the DeepSeek AI model:
export GROQ_API_KEY=xxx
./mvnw spring-boot:run -Dspring-boot.run.profiles=deepseek
-
Start the application and navigate to
http://localhost:8080/assistant
in your web browser. -
Enter a prompt describing the HTML content you want to generate.
-
Hit "Enter" to create the HTML content.
-
Review the generated content live on your browser.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.