Skip to content

zenika-open-source/agent-Z-communication-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Z communication assistant πŸ€–

Version License: MIT Java Quarkus GitHub

This Quarkus project uses Gemini and google-genai library to generate images from templates. This allows us to save time for our social network communication.

⚠️ Be careful about the images you use. Please contact the person if you are using their images before using them and integrating them into this API.

πŸ™Œ Features

  • πŸš€ Quarkus Framework: Fast startup and low memory footprint
  • πŸ€– Gemini AI Integration: Uses Google's latest Gemini models
  • 🎨 Image Generation: Creates images from pre-configured templates for blog posts and conference speakers
  • πŸŽ₯ Video Generation: Generate videos with Veo models
  • πŸ’» Picocli CLI: Rich command-line interface with comprehensive options
  • πŸ“ Post Generation: Generate LinkedIn & Bluesky posts
  • 🎯 Multiple Templates: Support for single and dual-author/speaker templates

πŸ› οΈ Prerequisites

  • Java 17 or higher
  • Maven 3.8+
  • Google AI API Key

πŸ‘¨β€πŸ’» Installation

  1. Clone the repository

    git clone [email protected]:zenika-open-source/agent-Z-communication-assistant.git
    cd agent-Z-communication-assistant
  2. Set up your Google AI API Key

    Option A: Environment Variable (Recommended)

    export GOOGLE_API_KEY=your-api-key-here

    Option B: Configuration File

    # Edit src/main/resources/application.properties
    google.ai.api.key=your-api-key-here
  3. Build the project

    mvn clean compile

πŸš€ Usage

Available Templates

The application provides several pre-configured templates for different use cases:

Image Templates

  1. generate-image-blog-post - Generate an image for a blog post (single author)

    • Fields: NAME, TITLE, PHOTO
  2. generate-image-2-blog-post - Generate an image for a blog post with 2 authors

    • Fields: NAME, NAME2, TITLE, PHOTO, PHOTO2
  3. generate-image-speaker-event - Generate an image to announce a speaker for a conference

    • Fields: NAME, TITLE, CONF_PHOTO, PHOTO
  4. generate-image-2-speaker-event - Generate an image to announce a talk with 2 speakers

    • Fields: NAME, NAME2, TITLE, PHOTO, PHOTO2, CONF_PHOTO

Video Templates

  1. generate-video-speaker-event - Generate a video to announce a speaker for a conference

Text Templates

  1. generate-post-speaker-event - Generate LinkedIn & Bluesky posts

Command Line Interface

Quick examples:

# Show help
mvn quarkus:dev -Dquarkus.args="--help"

# Generate image for a blog post (single author)
mvn quarkus:dev -Dquarkus.args="image --template-name generate-image-blog-post --title 'Introduction to DuckDB' --name 'John Doe' --photo images/people/john-doe.png -o output.png"

# Generate image for a blog post (2 authors)
mvn quarkus:dev -Dquarkus.args="image --template-name generate-image-2-blog-post --title 'Exploring Firebase Studio' --name 'Alice Smith' --name2 'Bob Johnson' --photo images/people/alice.png --photo2 images/people/bob.png -o output.png"

# Generate image for a conference speaker
mvn quarkus:dev -Dquarkus.args="image --template-name generate-image-speaker-event --title 'My Great Talk' --name 'Speaker Name' --photo images/people/speaker.png --conf-photo images/logos/conference.png -o output.png"

# Generate image for a conference with 2 speakers
mvn quarkus:dev -Dquarkus.args="image --template-name generate-image-2-speaker-event --title 'Firebase Studio' --name 'Benjamin Bourgeois' --name2 'Jean-Phi Baconnais' --photo images/people/benjamin-bourgeois.png --photo2 images/people/jeanphi-baconnais.png --conf-photo images/logos/conference.png -o output.png"

Running the Application

Development Mode (with hot reload):

mvn quarkus:dev

Production mode:

# Build
mvn clean package

# Run
java -jar target/quarkus-app/quarkus-run.jar --help

# Example: Generate image for a speaker event
java -jar target/quarkus-app/quarkus-run.jar image --template-name generate-image-speaker-event --title "My Great Talk" --name "Speaker Name" --photo images/people/speaker-photo.png --conf-photo images/logos/conference.png -o output.png

Configuration

The application can be configured through src/main/resources/application.properties:

# Google AI Configuration
google.ai.api.key=your-api-key-here

# Gemini Model Settings
app.gemini.model=gemini-2.0-flash-exp
app.gemini.model.veo=veo-2.0
app.result.filename=gemini-generation-image.png

# Video Generation Configuration
app.video.ratio=16:9
app.video.resolution=1080p

# Quarkus Configuration
quarkus.http.port=8080
quarkus.log.level=INFO

Key Configuration Options

  • google.ai.api.key: Your Google AI API key (required)
  • app.gemini.model: Gemini model for image generation (default: gemini-2.0-flash-exp)
  • app.gemini.model.veo: Veo model for video generation (default: veo-2.0)
  • app.result.filename: Default output filename for generated images
  • app.video.ratio: Video aspect ratio (e.g., 16:9, 9:16, 1:1)
  • app.video.resolution: Video resolution (e.g., 1080p, 720p, 4k)

Templates

Templates are defined in src/main/resources/templates.json. Each template specifies:

  • name: Unique identifier for the template
  • description: Human-readable description
  • type: Template type (IMAGE, VIDEO, or POST)
  • template: Path to the template image file
  • fields: Required fields for the template
  • prompt: AI prompt used to generate the content

To add a new template, edit templates.json and add a corresponding handler in GenerateImageCommand.java.

Supported Image Formats

The application automatically detects and supports the following image formats:

  • PNG (.png) - Recommended for templates with transparency
  • JPEG (.jpg, .jpeg) - Good for photographic templates
  • GIF (.gif) - Supports animated templates
  • WebP (.webp) - Modern format with good compression

πŸ™Œ Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

⁉️ Support

For support and questions:

πŸ“’ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Authors

  • Jean-Philippe Baconnais (@jeanphi-baconnais)

πŸ™ Contributors


Jean-Phi Baconnais

Benjamin

with love by zenika

About

This project allows to help up with Gemini to generate some images & videos

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •