Skip to main content

An all-in-one solution to empower your IM bot with LLM.

Project description

🇨🇳简体中文


Python package workflow Pylint workflow License: MIT

logo

AilingBot - An all-in-one solution to empower your IM bot with LLM.

Features

  • 💯Open source & free: Completely open source and free
  • 📦Out-of-the-box: No development required, pre-installed with the ability to integrate with existing mainstream IM and LLM models
  • 🔗Integrated with LangChain: Integrated with LangChain's ability to directly use pre-installed Chains or Agents
  • 🧩Modular: The project is organized in a modular way, with modules depending on abstract protocols between them. Similar modules can implement protocols and be used immediately
  • 💻Scalable: AilingBot's usage scenarios and capabilities can be expanded. For example, integrating with new IM, new LLM, or developing your own Chain, Agent, and chat policy
  • 🚀High performance: AilingBot uses coroutine-based asynchronous mode to improve system's high concurrency performance. At the same time, the core process can start multiple processes to further improve the system's high concurrency processing capability
  • 🔌Integrated through API: AilingBot provides a set of clear API interfaces for easy integration and collaboration with other systems and processes

List of supported IMs

Supported

  • Enterprise WeChat
  • Feishu

Coming soon

  • DingTalk
  • Slack

Quick Start Guide

Start an AI chatbot in 5 minutes

Below you will see how to quickly start a command-line-based AI chatbot through AilingBot, with the effect as shown in the figure: Command-line robot

💡First, you need an OpenAI API key. If you don't have one, apply here: https://platform.openai.com/account/api-keys

Through Docker

git clone https://github.com/ericzhang-cn/ailingbot.git ailingbot
cd ailingbot
docker build -t ailingbot .
docker run -it --rm -e AILINGBOT_POLICY__LLM__OPENAI_API_KEY={Your OpenAI API key} ailingbot poetry run ailingbot bot chat

Through PIP

Installation

pip install ailingbot

Generate configuration file

ailingbot init --silence --overwrite

At this point, a file called settings.toml will be created in the current directory, which is AilingBot's configuration file. Next, modify the necessary configurations. To start the robot, only one configuration is required. Find the following section in settings.toml:

[policy.llm]
_type = "openai"
model_name = "gpt-3.5-turbo"
openai_api_key = ""
temperature = 0

Change the value of openai_api_key to your real OpenAI API key.

Start the robot

Start the robot with the following command:

ailingbot bot chat

Integrating Instant Messaging Tools

Here's how to quickly integrate the above robot into Enterprise WeChat.

Through Docker

export AILINGBOT_CHANNEL__AGENTID={Your Enterprise WeChat application AgentId}
export AILINGBOT_CHANNEL__CORPSECRET={Your Enterprise WeChat application CorpSecret}
export AILINGBOT_CHANNEL__AES_KEY={Your Enterprise WeChat application Webhook AES Key}
export AILINGBOT_CHANNEL__CORPID={Your Enterprise WeChat application CorpId}
export AILINGBOT_CHANNEL__TOKEN={Your Enterprise WeChat application Webhook Token}
export AILINGBOT_POLICY__LLM__OPENAI_API_KEY={Your OpenAI API key}
docker compose up

Through PIP

Modify the configuration file

Open settings.toml and fill in the following section with your Enterprise WeChat application's real information:

[channel]
name = "wechatwork"
corpid = ""
corpsecret = ""
agentid = 0
token = ""
aes_key = ""

Start the service

ailingbot bot serve
ailingbot bot channel serve_agent
ailingbot bot channel serve_webhook

Finally, we need to go to the Enterprise WeChat management console to configure the webhook address so that Enterprise WeChat knows to forward the received user messages to our webhook. The URL of the webhook is: http(s)://your_public_IP:8080/webhook/wechatwork/event/

After completing the above configuration, you can find the robot in Enterprise WeChat and start a conversation:

Enterprise WeChat robot

Development Plan

  • Provide complete usage and developer documentation
  • Support more IM clients, such as DingTalk, Slack, etc.
  • Support more commonly used LLM prompting paradigms and out-of-the-box chat policy
  • Provide support for common capabilities in LLM Chain, such as Vector Embedding&Query and Grounding
  • Provide a WebUI
  • Provide one-click deployment capability based on Docker containers
  • Enhance system observability and govern

许可协议

MIT License

Copyright (c) 2023 AilingBot

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ailingbot-0.0.2.tar.gz (23.6 kB view hashes)

Uploaded Source

Built Distribution

ailingbot-0.0.2-py3-none-any.whl (31.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page