Echoshard / Gemini_Discordbot

A Gemini Discord bot that can accept images and has conversation memory
MIT License
67 stars 38 forks source link
ai discord-bot gemini-api google-cloud palm-api

Gemini Discord Bot

Discord bot that leverages the power of Google's Gemini-Pro API to interact with users in both text and image formats. It processes messages and images sent to it, generating creative and engaging responses.

UPDATE

This Gemini bot now is running Gemini Flash 1.5, PDF's and text files are now supported along with parsing transcripts from youtube videos and scraping of text from URLs.

The original bot that just does text and images is under GeminiSimple.py, If you don't want the extra capabilities and want to make something new.

Features

Setup

Requirements

Installation

  1. Clone the repository to your local machine.
  2. Install the required Python libraries:

    pip install -U -r requirements.txt

    The bot will start listening to messages in your Discord server. It responds to direct mentions or direct messages.

Configuration

  1. Create a .env file and copy the contents of .env.example into it

  2. Fill in the following values:

  1. Run GeminiDiscordBot.py

Commands

Additional Items

You can preprompt your request just like with images. If you just paste a URL and no context it default to the SUMMERIZE_PROMPT which is set to Give me 5 Bullets about feel free to change this in the code

Examples: Write me a tweet about {url} What did they think of {youtubeVideo transcript}

The system_prompt for Gemini Flash has been commented out just uncomment if you want to use it.

Development

Feel free to fork the project and customize it according to your needs. Make sure to follow the guidelines set by Discord and Google for bot development and API usage.

Limitations

Web Urls: