openaibot

⚡️ Build Your Own chatgpt Bot|🧀 Discord/Slack/Kook/Telegram |⛓ ToolCall|🔖 Plugin Support | 🌻 out-of-box | gpt-4o

https://github.com/llmkira/openaibot

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.0%) to scientific vocabulary

Keywords

assistant chat-gpt discordbot gpt-4 gpt-4-vision-preview gpt-4o gpt-4o-mini kook-bot openai slack-bot
Last synced: 6 months ago · JSON representation ·

Repository

⚡️ Build Your Own chatgpt Bot|🧀 Discord/Slack/Kook/Telegram |⛓ ToolCall|🔖 Plugin Support | 🌻 out-of-box | gpt-4o

Basic Info
Statistics
  • Stars: 1,983
  • Watchers: 20
  • Forks: 231
  • Open Issues: 5
  • Releases: 86
Topics
assistant chat-gpt discordbot gpt-4 gpt-4-vision-preview gpt-4o gpt-4o-mini kook-bot openai slack-bot
Created about 3 years ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License Citation

README.md

cover


docker docker workflow
telegram discord
license docker build

🍩 Deploy Docs & 🧀 Dev Docs & 🤝 Contribute

Python>=3.9

This project is not abandoned, just no new features are planned.

This project was developed as an experimental project for MQ event-driven LLM.

If you encounter a problem, please raise an Issue

If you are looking for similar projects, check out: https://github.com/AstrBotDevs/AstrBot


It integrates a message queuing and snapshot system, offering plugin mechanisms and authentication prior to plugin execution.

The bot adheres to the Openai Format Schema. Please adapt using gateway or one-api independently.

| Demo | Vision With Voice | Code Interpreter | |-------------------------------------------------------------------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------| | sticker | vision | code |

🔨 Roadmap

The program has iterated to its fourth generation.

  • [x] Removal of legacy code
  • [x] Deletion of metric system
  • [x] Deletion of model selection system, unified to OpenAI Schema
  • [x] Implementation of a more robust plugin system
  • [x] Project structure simplification
  • [x] Elimination of the Provider system
  • [x] Hook support
  • [x] Access to TTS
  • [x] Add standalone support for gpt-4-turbo and vision
  • [ ] Add LLM reference support to the plugin environment. (extract && search in text)

📦 Features

  • 🍪 A comprehensive plugin development ecosystem, adopting a classic design, and seamless integration with plugins through pip installation
  • 📝 Message system with no time or sender constraints, offering fully decoupled logics
  • 📬 Offers Login via a URL mechanism, providing a flexible and expandable authentication development solution
  • 🍰 Empowers users to authorize plugin execution. Users can configure plugin environment variables at their discretion
  • 📦 Support for plugins to access files
  • 🍟 Multi-platform support – extend new platforms by inheriting the base class
  • 🍔 Plugins can determine their appearance in new sessions dynamically, preventing performance degradation despite large amounts of plugins

🍔 Login Modes

  • Login via url: Use /login <a token>$<something like https://provider.com/login> to Login. The program posts the token to the interface to retrieve configuration information, how to develop this.
  • Login: Use /login https://<api endpoint>/v1$<api key>$<the model>$<tool model such as gpt-3.5-turbo> to login

🧀 Plugin Can Do More

| Sticker Converter | Timer Function(built-in) | |-------------------------------------|---------------------------------| | sticker | timer |

🎬 Platform Support

| Platform | Support | File System | Remarks | |----------|---------|-------------|----------------------------------------| | Telegram | ✅ | ✅ | | | Discord | ✅ | ✅ | | | Kook | ✅ | ✅ | Does not support triggering by reply | | Slack | ✅ | ✅ | Does not support triggering by reply | | Line | ❌ | | | | QQ | ❌ | | | | Wechat | ❌ | | | | Twitter | ❌ | | | | Matrix | ❌ | | | | IRC | ❌ | | | | ... | | | Create Issue/PR |

📦 Quick Start

Refer to the 🧀 Deployment Document for more information.

📦 One-click Deployment

If you are using a brand-new server, you can use the following shell to automatically install this project.

shell curl -sSL https://raw.githubusercontent.com/LLMKira/Openaibot/main/deploy.sh | bash

📦 Manual Installation

```shell

Install Voice dependencies

apt install ffmpeg

Install RabbitMQ

docker pull rabbitmq:3.10-management docker run -d -p 5672:5672 -p 15672:15672 \ -e RABBITMQDEFAULTUSER=admin \ -e RABBITMQDEFAULTPASS=8a8a8a \ --hostname myRabbit \ --name rabbitmq \ rabbitmq:3.10-management docker ps -l

Install Project

git clone https://github.com/LlmKira/Openaibot/ cd Openaibot pip install pdm pdm install -G bot cp .env.exp .env && nano .env

Test

pdm run python3 startsender.py pdm run python3 startreceiver.py

Host

apt install npm npm install pm2 -g pm2 start pm2.json ```

Be sure to change the default password for the command, or disable open ports to prevent the database from being scanned and attacked.

🥣 Docker

Build Hub: sudoskys/llmbot

Note that if you run this project using Docker, you will start Redis, MongoDB, and RabbitMQ. But if you're running locally, just RabbitMQ

Manual Docker-compose Installation

shell git clone https://github.com/LlmKira/Openaibot.git cd Openaibot cp .env.exp .env&&nano .env docker-compose -f docker-compose.yml up -d

The Docker configuration file docker-compose.yml contains all databases. In fact, Redis and MongoDB are not required. You can remove these databases yourself and use the local file system.

Update image using docker-compose pull.

Use docker exec -it llmbot /bin/bash to view Shell in Docker, enter exit to exit.

🍪 Slash Commands

shell clear - Deletes chat records login - Login to the bot help - Displays documentation chat - Conversation task - Use a function to converse ask - Disable function-based conversations tool - Lists all functions auth - Authorize a function env - Environment variables of the function learn - Learn your instructions, /learn reset to clear

💻 How to Develop Plugins?

Refer to the example plugins in the plugins directory and the 🧀 Plugin Development Document for plugin development documentation.

Hooks

Hooks control the EventMessage in sender and receiver. For example, we have voice_hook in built-in hooks.

you can enable it by setting VOICE_REPLY_ME=true in .env.

```shell /env VOICEREPLYME=yes

must

/env REECHOVOICEKEY=

not must

```

use /env VOICE_REPLY_ME=NONE to disable this env.

check the source code in llmkira/extra/voice_hook.py, learn to write your own hooks.

🧀 Sponsor

sponsor

📜 Notice

This project, named OpenAiBot, signifying "Open Artificial Intelligence Robot", is not officially affiliated with OpenAI.

FOSSA Status

Owner

  • Name: LLM Kira
  • Login: LlmKira
  • Kind: organization
  • Email: me@dianas.cyou
  • Location: Singapore

Cat Friendly Promotion Association Lab

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "sudoskys"
title: "Openaibot"
version: 2.0.4
url: "https://github.com/LlmKira/Openaibot"

GitHub Events

Total
  • Watch event: 72
  • Issue comment event: 4
  • Push event: 15
  • Pull request event: 10
  • Fork event: 15
  • Create event: 2
Last Year
  • Watch event: 72
  • Issue comment event: 4
  • Push event: 15
  • Pull request event: 10
  • Fork event: 15
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,537
  • Total Committers: 13
  • Avg Commits per committer: 118.231
  • Development Distribution Score (DDS): 0.061
Past Year
  • Commits: 34
  • Committers: 1
  • Avg Commits per committer: 34.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
sudoskys c****o@h****m 1,444
James Sky l****e@l****p 68
新城旧梦 3****m 5
purofle p****e@g****m 4
huige 6****3 4
IMGUGU.INK 1****f 2
InoriJV 3****n 2
G-Sea 1****a 2
Chi_Tang me@c****v 2
sparanoid t@s****m 1
fossabot b****s@f****o 1
Yidaozhan Ya y****q@g****m 1
MiuliKain 1****a 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 33
  • Total pull requests: 74
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 5
  • Total pull request authors: 2
  • Average comments per issue: 0.48
  • Average comments per pull request: 0.89
  • Merged pull requests: 71
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 9
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.89
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sudoskys (25)
  • liuran001 (1)
  • thinker007 (1)
  • sunrisewestern (1)
  • FrostleafChan (1)
Pull Request Authors
  • sudoskys (116)
  • FrostleafChan (1)
Top Labels
Issue Labels
New Features (10) Bug (4) Level High (3) Slow progress (2) To be decided (2) Broken Change (2) Plugin Api (2) Level Low (1) Test (1) Support New Platform (1)
Pull Request Labels
New Features (15) Support New Platform (2) Broken Change (2) Plugin Api (1) Bug (1) To be decided (1) Slow progress (1)

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 92
proxy.golang.org: github.com/llmkira/openaibot
  • Versions: 46
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
proxy.golang.org: github.com/LlmKira/Openaibot
  • Versions: 46
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago

Dependencies

.github/workflows/docker-ci.yaml actions
  • actions/checkout v3 composite
  • docker/build-push-action v3.2.0 composite
  • docker/login-action v2.1.0 composite
  • docker/metadata-action v4.1.1 composite
Dockerfile docker
  • python 3.10-slim build
docker-compose.yml docker
  • redis latest
  • sudoskys/openaibot main
Assistants/requirements.txt pypi
  • SpeechRecognition *
  • pyaudio *
requirements.txt pypi
  • Pillow *
  • aiohttp *
  • apscheduler *
  • beautifulsoup4 *
  • elara *
  • fastapi *
  • fasttext >=0.9.1
  • graia-ariadne *
  • graia-broadcast *
  • graiax-silkcoder *
  • httpx *
  • jieba *
  • loguru *
  • nltk *
  • numpy *
  • openai *
  • openai-kira >=0.2.2
  • pathlib *
  • pyTelegramBotAPI *
  • pycorrector *
  • pydantic *
  • redis *
  • requests >=2.22.0
  • rich *
  • rtoml *
  • scikit-learn *
  • transformers *
  • uvicorn *
  • wget *