A Spring Boot application that generates professional email replies based on user-provided content and tone. Perfect for creating tailored and polished email responses effortlessly using the Gemini API.
- Dynamic Reply Generation: Craft professional replies in seconds.
- Customizable Tone: Generate responses with a tone that matches your style (e.g., formal, polite, friendly).
- Gemini API Integration: Powered by advanced AI text generation.
- RESTful API: Easy-to-use
/generate
endpoint for seamless integration.
- Java: Core language for implementation.
- Spring Boot: Framework for building and managing the backend.
- WebClient: For making HTTP requests to external APIs.
- Jackson: For handling JSON data efficiently.
- User Input:
- Provide the original email content and the desired tone.
- Prompt Generation:
- A custom prompt is dynamically created based on your input.
- Gemini API Request:
- The application sends the generated prompt to the Gemini API.
- Response Parsing:
- The response is processed to extract the generated email reply.
git clone https://github.com/yourusername/email-reply-generator.git
cd email-reply-generator
Add your Gemini API Key and API URL in the application.properties
file:
gemini.api.key=YOUR_GEMINI_API_KEY
gemini.api.url=YOUR_GEMINI_API_URL
./mvnw spring-boot:run
URL: http://localhost:8080/api/email/generate
Method: POST
Body:
{
"emailContent": "Can we reschedule our meeting?",
"tone": "polite"
}
{
"reply": "Certainly! I appreciate your time and flexibility. Please let me know your availability, and I will do my best to accommodate."
}
- Email Content: "Can you share the project status update by EOD?"
- Tone: Formal
"Thank you for your message. I will ensure the project status update is shared with you by the end of the day. Please let me know if there’s anything specific you’d like included."
src
├── main
│ ├── java
│ │ ├── com.talha.emailreplier
│ │ │ ├── controllers
│ │ │ │ └── EmailGeneratorController.java
│ │ │ ├── entities
│ │ │ │ └── EmailRequest.java
│ │ │ ├── service
│ │ │ │ └── EmailGeneratorService.java
│ ├── resources
│ │ ├── application.properties
- Add support for multiple languages.
- Enhance the tone generation logic for more personalized replies.
- Integrate with email providers (e.g., Gmail, Outlook) for end-to-end automation.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Make your changes and commit:
git commit -m "Add some feature"
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
If you have any feedback, please feel free to open an issue or contact me at your-email@example.com.