Giter Site home page Giter Site logo

discollama's Introduction

๐Ÿ•บ Discollama ๐Ÿฆ™

Discollama is a Discord bot project written in Go. It uses the DiscordGo library to interact with the Discord API and provides users with the ability to generate text using models locally hosted using Ollama.

๐Ÿ“š Table of Contents

๐Ÿ—๏ธ Structure

The project has the following structure:

go.mod
go.sum
main.go
utils/
	helpers/
		helpers.go
	ollama/
		ollama.go

๐Ÿ“ฆ Dependencies

The project uses the following dependencies:

  • github.com/bwmarrin/discordgo for interacting with the Discord API.

๐Ÿ”‘ Prerequisites

  • Go installed on your system.
  • Ollama installed on your system or a gollama API server accessible from your machine. (Default: http://localhost:11434) Read more about customizing the base URL here.
  • Atleast one model installed on your Ollama server. You can install models using the ollama pull <model-name> command. To find a list of all available models, check the Ollama Library. You can also use the ollama list command to list all locally installed models.
  • A Discord bot token. You can create a new bot on the Discord Developer Portal.

โš™๏ธ Setup

To set up the bot, you need to provide the bot token and guild ID as command-line arguments. You can also specify whether to remove all commands after shutting down the bot. Optionally, you can provide the URL of the Ollama API.

Usage of discollama:
  -guild string
        Test guild ID. If not passed - bot registers commands globally
  -ollama-url string
        Ollama API URL (default "http://localhost:11434")
  -rmcmd
        Remove all commands after shutdowning or not (default true)
  -token string
        Bot access toke

Example:

go run main.go -token YOUR_BOT_TOKEN -guild YOUR_GUILD_ID -ollama-url YOUR_OLLAMA_URL -rmcmd true

๐ŸŽฎ Usage

Currently, the bot supports a single slash command /generate which lets users pick a model and ask the bot to generate text based on a provided prompt. The bot will then query the Ollama API to generate text and respond back to the user.

Using the slash command (/generate): slash_command

Example Response

response

๐Ÿ—บ๏ธ Roadmap

Here are the upcoming features we plan to implement:

  • Add more commands for users to interact with.
  • Improve error handling and logging.
  • Implement a database for persistent data storage. (To keep chat context).
  • Implement ability to attach images for multi-modal LLMs.
  • Implement ability to attach pdfs for RAG.

๐Ÿค Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

๐Ÿ“„ License

This project is licensed under the MIT License.

discollama's People

Contributors

gaurav-gosain avatar

Stargazers

 avatar

Watchers

 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.