llmkira


Namellmkira JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://llmkira.github.io/Docs/
SummaryA chain message bot based on OpenAI
upload_time2024-04-29 08:54:00
maintainerNone
docs_urlNone
authorNone
requires_python<3.12,>=3.9
licenseApache-2.0
keywords llmbot llmkira openai chatgpt llm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![cover](https://raw.githubusercontent.com/LlmKira/.github/main/llmbot/project_cover.png)

------------------

<p align="center">
<a href="https://hub.docker.com/repository/docker/sudoskys/llmbot/general">
    <img src="https://img.shields.io/docker/pulls/sudoskys/llmbot" alt="docker">
</a>
<a href="https://badge.fury.io/py/llmkira">
    <img src="https://badge.fury.io/py/llmkira.svg" alt="docker workflow">
</a>
<br />
<a href="https://t.me/Openai_LLM">
    <img src="https://img.shields.io/badge/Join-Telegram-blue" alt="telegram">
</a>
<a href="https://discord.gg/6QHNdwhdE5">
    <img src="https://img.shields.io/badge/Join-Discord-blue" alt="discord">
</a>
<br/>
<a href="https://raw.githubusercontent.com/llmkira/openaibot/main/LICENSE">
    <img src="https://img.shields.io/github/license/llmkira/openaibot" alt="license">
</a>
<a href="https://hub.docker.com/repository/docker/sudoskys/llmbot/builds">
    <img src="https://img.shields.io/docker/v/sudoskys/llmbot" alt="docker build">
</a>
</p>

<p align="center">
  <a href="https://llmkira.github.io/Docs/">🍩 Deploy Docs</a>
  &
  <a href="https://llmkira.github.io/Docs/dev/basic">🧀 Dev Docs</a>
  &
  <a href=".github/CONTRIBUTING.md">🤝 Contribute</a>
</p>

> Don't hesitate to Star ⭐️, Issue 📝, and PR 🛠️

> Python>=3.9

This project uses the ToolCall feature.

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](https://github.com/Portkey-AI/gateway)
or [one-api](https://github.com/songquanpeng/one-api) independently.

| Demo                                                                          | Vision With Voice                                                        | Code Interpreter                                                                      |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| ![sticker](https://github.com/LlmKira/Openaibot/raw/main/docs/chain_chat.gif) | ![vision](https://github.com/LlmKira/Openaibot/raw/main/docs/vision.gif) | ![code](https://github.com/LlmKira/Openaibot/raw/main/docs/code_interpreter_func.gif) |

## 🔨 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](https://github.com/LlmKira/Openaibot/blob/81eddbff0f136697d5ad6e13ee1a7477b26624ed/app/components/credential.py#L20).
- `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](./docs/sticker_func.gif) | ![timer](./docs/timer_func.gif) |

### 🎬 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](https://llmkira.github.io/Docs/) 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 RABBITMQ_DEFAULT_USER=admin \
  -e RABBITMQ_DEFAULT_PASS=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 start_sender.py
pdm run python3 start_receiver.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](https://hub.docker.com/repository/docker/sudoskys/llmbot/general)

> 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
help - Displays documentation
chat - Conversation
task - Use a function to converse
ask - Disable function-based conversations
tool - Lists all functions
login - Login
auth - Authorize a function
env - Environment variables of the function
```

## 💻 How to Develop Plugins?

Refer to the example plugins in the `plugins` directory and
the [🧀 Plugin Development Document](https://llmkira.github.io/Docs/dev/basic) 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 VOICE_REPLY_ME=yes
# must

/env REECHO_VOICE_KEY=<key in dev.reecho.ai>
# 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](./.github/sponsor_ohmygpt.png)](https://www.ohmygpt.com)

## 📜 Notice

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


[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot?ref=badge_small)

            

Raw data

            {
    "_id": null,
    "home_page": "https://llmkira.github.io/Docs/",
    "name": "llmkira",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.9",
    "maintainer_email": null,
    "keywords": "llmbot, llmkira, openai, chatgpt, llm",
    "author": null,
    "author_email": "sudoskys <me@dianas.cyou>, llmkira <me@dianas.cyou>",
    "download_url": "https://files.pythonhosted.org/packages/9d/3f/3a52a56dba60412852e2373c09f27e51f31b0cf6f21d9a42f4cda61e0bb9/llmkira-1.0.5.tar.gz",
    "platform": null,
    "description": "![cover](https://raw.githubusercontent.com/LlmKira/.github/main/llmbot/project_cover.png)\n\n------------------\n\n<p align=\"center\">\n<a href=\"https://hub.docker.com/repository/docker/sudoskys/llmbot/general\">\n    <img src=\"https://img.shields.io/docker/pulls/sudoskys/llmbot\" alt=\"docker\">\n</a>\n<a href=\"https://badge.fury.io/py/llmkira\">\n    <img src=\"https://badge.fury.io/py/llmkira.svg\" alt=\"docker workflow\">\n</a>\n<br />\n<a href=\"https://t.me/Openai_LLM\">\n    <img src=\"https://img.shields.io/badge/Join-Telegram-blue\" alt=\"telegram\">\n</a>\n<a href=\"https://discord.gg/6QHNdwhdE5\">\n    <img src=\"https://img.shields.io/badge/Join-Discord-blue\" alt=\"discord\">\n</a>\n<br/>\n<a href=\"https://raw.githubusercontent.com/llmkira/openaibot/main/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/llmkira/openaibot\" alt=\"license\">\n</a>\n<a href=\"https://hub.docker.com/repository/docker/sudoskys/llmbot/builds\">\n    <img src=\"https://img.shields.io/docker/v/sudoskys/llmbot\" alt=\"docker build\">\n</a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://llmkira.github.io/Docs/\">\ud83c\udf69 Deploy Docs</a>\n  &\n  <a href=\"https://llmkira.github.io/Docs/dev/basic\">\ud83e\uddc0 Dev Docs</a>\n  &\n  <a href=\".github/CONTRIBUTING.md\">\ud83e\udd1d Contribute</a>\n</p>\n\n> Don't hesitate to Star \u2b50\ufe0f, Issue \ud83d\udcdd, and PR \ud83d\udee0\ufe0f\n\n> Python>=3.9\n\nThis project uses the ToolCall feature.\n\nIt integrates a message queuing and snapshot system, offering plugin mechanisms and authentication prior to plugin\nexecution.\n\nThe bot adheres to the **Openai Format Schema**. Please adapt using [gateway](https://github.com/Portkey-AI/gateway)\nor [one-api](https://github.com/songquanpeng/one-api) independently.\n\n| Demo                                                                          | Vision With Voice                                                        | Code Interpreter                                                                      |\n|-------------------------------------------------------------------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| ![sticker](https://github.com/LlmKira/Openaibot/raw/main/docs/chain_chat.gif) | ![vision](https://github.com/LlmKira/Openaibot/raw/main/docs/vision.gif) | ![code](https://github.com/LlmKira/Openaibot/raw/main/docs/code_interpreter_func.gif) |\n\n## \ud83d\udd28 Roadmap\n\n> The program has iterated to its fourth generation.\n\n- [x] Removal of legacy code\n- [x] Deletion of metric system\n- [x] Deletion of model selection system, unified to OpenAI Schema\n- [x] Implementation of a more robust plugin system\n- [x] Project structure simplification\n- [x] Elimination of the Provider system\n- [x] Hook support\n- [x] Access to TTS\n- [x] Add standalone support for gpt-4-turbo and vision\n- [ ] Add LLM reference support to the plugin environment. (extract && search in text)\n\n## \ud83d\udce6 Features\n\n- \ud83c\udf6a A comprehensive plugin development ecosystem, adopting a classic design, and seamless integration with plugins\n  through `pip` installation\n- \ud83d\udcdd Message system with no time or sender constraints, offering fully decoupled logics\n- \ud83d\udcec Offers Login via a URL mechanism, providing a flexible and expandable authentication development solution\n- \ud83c\udf70 Empowers users to authorize plugin execution. Users can configure plugin environment variables at their discretion\n- \ud83d\udce6 Support for plugins to access files\n- \ud83c\udf5f Multi-platform support \u2013 extend new platforms by inheriting the base class\n- \ud83c\udf54 Plugins can determine their appearance in new sessions dynamically, preventing performance degradation despite large\n  amounts of plugins\n\n### \ud83c\udf54 Login Modes\n\n- `Login via url`: Use `/login <a token>$<something like https://provider.com/login>` to Login. The program posts the token to the interface to\n  retrieve configuration\n  information, [how to develop this](https://github.com/LlmKira/Openaibot/blob/81eddbff0f136697d5ad6e13ee1a7477b26624ed/app/components/credential.py#L20).\n- `Login`: Use `/login https://<api endpoint>/v1$<api key>$<the model>$<tool model such as gpt-3.5-turbo>` to login\n\n### \ud83e\uddc0 Plugin Can Do More\n\n| Sticker Converter                   | Timer Function(built-in)        |\n|-------------------------------------|---------------------------------|\n| ![sticker](./docs/sticker_func.gif) | ![timer](./docs/timer_func.gif) |\n\n### \ud83c\udfac Platform Support\n\n| Platform | Support | File System | Remarks                                |\n|----------|---------|-------------|----------------------------------------|\n| Telegram | \u2705       | \u2705           |                                        |\n| Discord  | \u2705       | \u2705           |                                        |\n| Kook     | \u2705       | \u2705           | Does not support `triggering by reply` |\n| Slack    | \u2705       | \u2705           | Does not support `triggering by reply` |\n| Line     | \u274c       |             |                                        |\n| QQ       | \u274c       |             |                                        |\n| Wechat   | \u274c       |             |                                        |\n| Twitter  | \u274c       |             |                                        |\n| Matrix   | \u274c       |             |                                        |\n| IRC      | \u274c       |             |                                        |\n| ...      |         |             | Create Issue/PR                        |\n\n## \ud83d\udce6 Quick Start\n\nRefer to the [\ud83e\uddc0 Deployment Document](https://llmkira.github.io/Docs/) for more information.\n\n### \ud83d\udce6 One-click Deployment\n\nIf you are using a brand-new server, you can use the following shell to automatically install this project.\n\n```shell\ncurl -sSL https://raw.githubusercontent.com/LLMKira/Openaibot/main/deploy.sh | bash\n```\n\n### \ud83d\udce6 Manual Installation\n\n```shell\n# Install Voice dependencies\napt install ffmpeg\n# Install RabbitMQ\ndocker pull rabbitmq:3.10-management\ndocker run -d -p 5672:5672 -p 15672:15672 \\\n  -e RABBITMQ_DEFAULT_USER=admin \\\n  -e RABBITMQ_DEFAULT_PASS=8a8a8a \\\n  --hostname myRabbit \\\n  --name rabbitmq \\\n  rabbitmq:3.10-management\ndocker ps -l\n# Install Project\ngit clone https://github.com/LlmKira/Openaibot/\ncd Openaibot\npip install pdm\npdm install -G bot\ncp .env.exp .env && nano .env\n# Test\npdm run python3 start_sender.py\npdm run python3 start_receiver.py\n# Host\napt install npm\nnpm install pm2 -g\npm2 start pm2.json\n```\n\n> **Be sure to change the default password for the command, or disable open ports to prevent the database from being\nscanned and attacked.**\n\n### \ud83e\udd63 Docker\n\nBuild Hub: [sudoskys/llmbot](https://hub.docker.com/repository/docker/sudoskys/llmbot/general)\n\n> Note that if you run this project using Docker, you will start Redis, MongoDB, and RabbitMQ. But if you're running\n> locally, just RabbitMQ\n\n#### Manual Docker-compose Installation\n\n```shell\ngit clone https://github.com/LlmKira/Openaibot.git\ncd Openaibot\ncp .env.exp .env&&nano .env\ndocker-compose -f docker-compose.yml up -d\n```\n\nThe Docker configuration file `docker-compose.yml` contains all databases. In fact, Redis and MongoDB are not required.\nYou can remove these databases yourself and use the local file system.\n\nUpdate image using `docker-compose pull`.\n\nUse `docker exec -it llmbot /bin/bash` to view Shell in Docker, enter `exit` to exit.\n\n## \ud83c\udf6a Slash Commands\n\n```shell\nclear - Deletes chat records\nhelp - Displays documentation\nchat - Conversation\ntask - Use a function to converse\nask - Disable function-based conversations\ntool - Lists all functions\nlogin - Login\nauth - Authorize a function\nenv - Environment variables of the function\n```\n\n## \ud83d\udcbb How to Develop Plugins?\n\nRefer to the example plugins in the `plugins` directory and\nthe [\ud83e\uddc0 Plugin Development Document](https://llmkira.github.io/Docs/dev/basic) for plugin development documentation.\n\n### Hooks\n\nHooks control the EventMessage in sender and receiver. For example, we have `voice_hook` in built-in hooks.\n\nyou can enable it by setting `VOICE_REPLY_ME=true` in `.env`.\n\n```shell\n/env VOICE_REPLY_ME=yes\n# must\n\n/env REECHO_VOICE_KEY=<key in dev.reecho.ai>\n# not must\n```\n\nuse `/env VOICE_REPLY_ME=NONE` to disable this env.\n\ncheck the source code in `llmkira/extra/voice_hook.py`, learn to write your own hooks.\n\n## \ud83e\uddc0 Sponsor\n\n[![sponsor](./.github/sponsor_ohmygpt.png)](https://www.ohmygpt.com)\n\n## \ud83d\udcdc Notice\n\n> This project, named OpenAiBot, signifying \"Open Artificial Intelligence Robot\", is not officially affiliated with\n> OpenAI.\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot?ref=badge_small)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A chain message bot based on OpenAI",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://llmkira.github.io/Docs/",
        "Repository": "https://github.com/LlmKira/Openaibot"
    },
    "split_keywords": [
        "llmbot",
        " llmkira",
        " openai",
        " chatgpt",
        " llm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d99f8fe4c3d4f8bb4f7f1a6521e68fd47bc9accbf403a3ecd176ebcbee2bde6c",
                "md5": "3ab6ad39cc7b7fada19dc5549f897f3f",
                "sha256": "66cb5968b3240d2b1f418d3fb7234bfe0a64b944f777854cf95436111de4ae1c"
            },
            "downloads": -1,
            "filename": "llmkira-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3ab6ad39cc7b7fada19dc5549f897f3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.9",
            "size": 76016,
            "upload_time": "2024-04-29T08:53:58",
            "upload_time_iso_8601": "2024-04-29T08:53:58.684599Z",
            "url": "https://files.pythonhosted.org/packages/d9/9f/8fe4c3d4f8bb4f7f1a6521e68fd47bc9accbf403a3ecd176ebcbee2bde6c/llmkira-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d3f3a52a56dba60412852e2373c09f27e51f31b0cf6f21d9a42f4cda61e0bb9",
                "md5": "b598e27bd227a630dd5d7cf739b36b97",
                "sha256": "a8d7f78184a45b1182ed7c840f093e1341f04c49b10b6a50dd02d2a9fd7c0d89"
            },
            "downloads": -1,
            "filename": "llmkira-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b598e27bd227a630dd5d7cf739b36b97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.9",
            "size": 57842,
            "upload_time": "2024-04-29T08:54:00",
            "upload_time_iso_8601": "2024-04-29T08:54:00.853689Z",
            "url": "https://files.pythonhosted.org/packages/9d/3f/3a52a56dba60412852e2373c09f27e51f31b0cf6f21d9a42f4cda61e0bb9/llmkira-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 08:54:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LlmKira",
    "github_project": "Openaibot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "llmkira"
}
        
Elapsed time: 0.24574s