Giter Club home page Giter Club logo

gpt-4v-discord-bot-example's Introduction

A simple Discord bot showing how to use GPT-4's Vision to understand videos

Overview

This repository contains a simple Discord bot demonstrating the use of GPT-4 Vision (GPT-4V) with the OpenAI API. It can process text, images, and videos (passing 25% of the frames from a video).

gpt4vbotexample.mp4

Features

  • Handles image attachments in formats including PNG, JPG, JPEG, and WEBP.
  • Processes video attachments, extracting frames from MP4, MOV, and WEBM files.
  • Will never max out model token limit in a discord conversation, as messages are handled seperately from one another.

NOTE:

This repository is a proof of concept and is not intended to be used as-is for any deployment. I would highly recommend modifying this code to bring more functionality out of any Discord Bot you're planning to make with this.

Requirements

The following libraries and environments are required:

Installation

Follow these steps to set up the bot:

  1. Clone or download the source code from the repository.
  2. Install the required Python packages:
    pip install -r requirements.txt
  3. Set up your env file in the project's root directory with your Discord and OpenAI API keys:
    DISCORD_TOKEN=<your_discord_token>
    OPENAI_API_KEY=<your_openai_api_key>
    

Usage

To use the bot:

  1. Run the bot script from your command line:

    python gpt-4v-bot.py
  2. In your Discord server, interact with the bot by sending text, images, or videos.

Contributing

Contributions for improvements or new features are welcome. Please use the standard workflow of fork, branch, and pull request for contributions.

License

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

Acknowledgements

gpt-4v-discord-bot-example's People

Contributors

kesku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.