
Qbot
快速部署具有极强AI自控自由度的大语言模型AI-QQ机器人,自带联网,AI驱动的提示词切换,AI驱动的中期记忆,长期记忆能力,AI自主分段回复,可附加包含语音,绘画,全曲库翻唱等功能
Stars: 64

Qbot is an open-source project designed to help users quickly build their own QQ chatbot. The bot deployed using this project has various capabilities, including intelligent sentence segmentation, intent recognition, voice and drawing replies, autonomous selection of when to play local music, and decision-making on sending emojis. Qbot leverages other open-source projects and allows users to customize triggers, system prompts, chat models, and more through configuration files. Users can modify the Qbot.py source code to tailor the bot's behavior. The project requires NTQQ and LLonebot's NTQQ plugin for deployment, along with additional configurations for triggers, system prompts, and chat models. Users can start the bot by running Qbot.py after installing necessary libraries and ensuring the NTQQ is running. Qbot also supports features like sending music from the data/smusic folder and emojis based on emotions. Local voice synthesis can be deployed for voice outputs. Qbot provides commands like #reset to clear short-term memory and addresses common issues like program crashes due to encoding format, message sending/receiving failures, voice synthesis failures, and connection issues. Users are encouraged to give the project a star if they find it useful.
README:
1.加入更多管理员指令:
触发词#addid 群友id:将群友添加为当前群qbot管理员,有权限使用几乎所有指令
触发词#forcememory 记忆内容:强制AI添加本群中期记忆
触发词#forceallmemory 记忆内容:强制AI在所有群添加中期记忆(只有set里面配置的id可使用此指令)
2.简化配置难度,将更多配置整合在set.json中(说话人,歌者以及是否启用相应能力配置等)
3.兼容某些AI接口流式传输时一个流传输多个token的情况,修复相关bug
4.修改AI自动切换设定及情感的相关参数为更合适的值
5.修复已知bug
1.加入管理员功能和指令:在set.json里面填写管理员qq号列表即可,指令包括:“触发词#mood 情绪”(设置本群AI的情绪,相关情绪在set里面的系统人设里面修改或添加),“触发词#random 整数”(修改本群AI无触发词的触发概率,整数小于等于0关闭当前群AI)
2.加入多情绪系统提示词功能,可由AI自行切换或管理员手动切换单群的AI情绪模式,即“触发词#mood 情绪”(设置本群AI的情绪,相关情绪在set里面的系统人设里面修改或添加)指令
3.加入单群AI无触发词触发概率修改指令,可修改当前群的触发概率,若设置为0或负值,即可关闭AI在本群的所有能力,后续再设置为正值恢复工作,即“触发词#random 整数”(修改本群AI无触发词的触发概率,整数小于等于0关闭当前群AI)
4.略微增加记忆容量和上下文轮数,限制长期记忆总量
5.修复私聊切换情绪bug
6.将私聊下的歌唱功能改为从群聊翻唱产生的音频中检索歌唱文件,所以群里唱过的歌就可以在私聊中唱了
1.兼容了智谱清言的绘画模型(可以白嫖)
2.加入模型图兜底机制,将模型团首个模型作为兜底模型,用于弥补模型团中若有模型有问题导致偶尔AI不回复的问题,因此首个模型应以稳定为主
3.新功能歌曲AI翻唱:引入一键AI翻唱方案,实现AI自动抓取网易云音乐并预处理后采用svc翻唱(同样由AI自动确定触发时机,只适用于群聊,可自行修改代码扩展至私聊)新功能需要下载工具整合包链接:https://pan.quark.cn/s/ecae6ee123b4 (下载好后按照配置或训练svc的方法就行配置或训练,然后启动文件夹下的启动服务端.bat,最后在qbot源代码里面修改歌唱者为svc对应歌唱者名就可以了,注意训练好的模型放在翻唱整合包的logs文件夹下,目录结构参考logs下的illue)【如果报错缺少"wcwidth"库,就进入翻唱整合包里面的workenv下打开cmd输入 python -m pip install wcwidth即可解决】
1.采用模型团方案,可以填写多个模型,根据权重调用,建议选取一个高性能模型和两个便宜模型,既可以在保证能力的同时节省费用,还可以避免大模型回复模板化的问题
2.允许AI自己在适当的时候发送data/smusic文件夹内的歌曲【本功能已在10.25次更新中被AI翻唱功能取代】
3.允许多个触发词(在set.json里配置)
4.允许多个屏蔽名称(在set.json里配置)
5.增加更多set.json可配置内容
6.增加由AI自己驱动总结的中期记忆能力(效果明显)[写入记忆]
7.允许AI拒绝回答不相干问题[pass]
8.将file.py集成在Qbot中,不需要再手动启动
9.AI自己根据需要和对应情绪发送表情包图片
感谢大家使用本开源项目,本项目旨在快速帮助大家构建一个自己的QQ机器人
本项目部署的qq机器人拥有以下能力:
1.智能断句:利用AI能力为输出打上断句标签,合理断句,既可以保证长内容回复的完整性,
也可以避免AI回复长段内容
2.智能意图判断:利用AI能力给输出打上标签,实现不同回复内容经过特殊函数处理,例如
文本转语音,AI绘图等
3.拥有语音回复,AI绘画回复等常见的回复形式,让回复更加多样化
4.由AI自己选择或决定何时播放播放本地歌曲
5.由AI自己决定发送表情包的时机
本项目站在巨人的肩膀上,使用了其他的一些开源项目,大家可以给对应项目点一个star哦~
-
首先,下载并安装NTQQ(一种新架构的QQ电脑端): NTQQ下载链接
-
安装LLonebot的NTQQ插件: NTQQ插件链接 安装方法:点击查看 如果是Windows系统,注意下载如下名称的较新版本exe:
-
配置LLonebot插件: 安装好插件后,打开ntqq进入插件设置 填写各种信息(千万不要忘记填写端口号)后,注意保存!!!
-
配置: 进入此文件
解释:
-
triggers
后面填入触发词列表,可设置多个触发词,如果用户发送的消息里包含这个词,会触发回复。 -
system_prompt
后面填的就是AI人设,建议参考默认人设的格式,效果会更好。 -
chat_models
后面填模型团列表信息,其中每个模型信息需要填写请求api,模型名称,请求key;切忌自己编造,需查看模型官方开发者文档,按照官方模型名称严格填写,此项将影响请求模型对象。 - 其他的配置项大家应该可以看懂是什么,画图模型配置类比文本模型。
-
-
修改:
- 进入
Qbot.py
源代码编辑页面。
- 进入
-
启动:
打开命令行(win+r,输入cmd并回车),先cd到Qbot-main根目录。可选,推荐大佬/开发者: cmd: 使用venv来避免污染全局环境
创建venv:python -m venv .venv
激活venv:
.venv/Scripts/activate.bat
PowerShell: 激活venv:
.venv/Scripts/activate.ps1
(如果PowerShell报不允许执行)修改该PowerShell实例脚本执行策略:
Set-ExecutionPolicy RemoteSigned -Scope Process
必须:安装必要的库:
python -m pip install -r requirements.txt
保持NTQQ的运行状态,然后使用
python Qbot.py
完成启动。
(如果使用venv请先激活venv)
(遇到问题可以联系开发者幻日QQ:2141073363,可选venv遇到问题可以联系观赏鱼QQ:2082895869)
将音乐放在data/smusic文件夹下,AI适当的时候会自己从中选取合适歌曲发送(音乐不适宜太多(<20个),否则AI可能不按要求选取歌曲)【本功能已在10.25次更新中被AI翻唱功能取代】 表情包放在data/image/情绪对应文件夹下,目前只有happy,angry,sad,bored,fear五个情绪,可以自行向文件夹中添加表情包,某些格式文件可能不支持
由于我的服务器可能无法支撑大量的语音合成请求,所以大家需要自己部署本地语音合成。本地语音合成可以使用AI桌宠的语音合成服务(即箱庭GPT-Sovits整合包,使用花火模型,双击starttts.bat即可),二者接口格式一样。
箱庭GPT-Sovits整合包项目 箱庭GPT-Sovits整合包文档
部署好之后,只需要启动其中的后端并在根目录按照格式建立空文件夹([Qbot根目录]\data\voice)即可,本项目会自动使用本地语音合成进行语音输出。
如果启用了绘画或者语音合成等需要发送文件到QQ的服务时,不需要同时启动另一个名为file.py
的程序。此程序已经内置于Qbot中
注意:需要等待Qbot.py
加载完记忆再启动,否则有概率导致Qbot.py
无法收发信息!!!
-
#reset
:清空当前聊天(群聊/私聊)短期记忆。
- 程序闪退:很可能是因为
set.json
的编码格式不对,推测因为经常使用windows记事本编辑导致编码格式自动转换为UTF-8 with BOM,此处建议安装VScode,然后用VScode打开json,在右下角点击UTF-8 with BOM
,在顶部的选项栏中选择保存为编码格式
,点击UTF-8
即可。 - 无法接收发送消息且无报错:建议检查QQ插件设置项填写是否完整,尤其是请求地址。
- 语音合成失败:玄学问题,建议关了重开。
- 语音合成提示无需重复启动(桌宠用户常见问题):建议把所有Python后台都删掉再试试(推荐);或者直接修改
starttts.bat
,将其后台进程检测判断逻辑删除即可(不建议)。 - “由于远程主机积极拒绝,无法连接”:可能是请求次数过多,超过了每分钟或每天的请求次数限制,等一等就好。
-
break limitless turn
:正常行为。AI之间防刷屏的代码。
觉得本项目有用的话就点一个star吧~
For Tasks:
Click tags to check more tools for each tasksFor Jobs:
Alternative AI tools for Qbot
Similar Open Source Tools

Qbot
Qbot is an open-source project designed to help users quickly build their own QQ chatbot. The bot deployed using this project has various capabilities, including intelligent sentence segmentation, intent recognition, voice and drawing replies, autonomous selection of when to play local music, and decision-making on sending emojis. Qbot leverages other open-source projects and allows users to customize triggers, system prompts, chat models, and more through configuration files. Users can modify the Qbot.py source code to tailor the bot's behavior. The project requires NTQQ and LLonebot's NTQQ plugin for deployment, along with additional configurations for triggers, system prompts, and chat models. Users can start the bot by running Qbot.py after installing necessary libraries and ensuring the NTQQ is running. Qbot also supports features like sending music from the data/smusic folder and emojis based on emotions. Local voice synthesis can be deployed for voice outputs. Qbot provides commands like #reset to clear short-term memory and addresses common issues like program crashes due to encoding format, message sending/receiving failures, voice synthesis failures, and connection issues. Users are encouraged to give the project a star if they find it useful.

Director
Director is a framework to build video agents that can reason through complex video tasks like search, editing, compilation, generation, etc. It enables users to summarize videos, search for specific moments, create clips instantly, integrate GenAI projects and APIs, add overlays, generate thumbnails, and more. Built on VideoDB's 'video-as-data' infrastructure, Director is perfect for developers, creators, and teams looking to simplify media workflows and unlock new possibilities.

lunary
Lunary is an open-source observability and prompt platform for Large Language Models (LLMs). It provides a suite of features to help AI developers take their applications into production, including analytics, monitoring, prompt templates, fine-tuning dataset creation, chat and feedback tracking, and evaluations. Lunary is designed to be usable with any model, not just OpenAI, and is easy to integrate and self-host.

BentoML
BentoML is an open-source model serving library for building performant and scalable AI applications with Python. It comes with everything you need for serving optimization, model packaging, and production deployment.

open-parse
Open Parse is a Python library for visually discerning document layouts and chunking them effectively. It is designed to fill the gap in open-source libraries for handling complex documents. Unlike text splitting, which converts a file to raw text and slices it up, Open Parse visually analyzes documents for superior LLM input. It also supports basic markdown for parsing headings, bold, and italics, and has high-precision table support, extracting tables into clean Markdown formats with accuracy that surpasses traditional tools. Open Parse is extensible, allowing users to easily implement their own post-processing steps. It is also intuitive, with great editor support and completion everywhere, making it easy to use and learn.

Whisper-WebUI
Whisper-WebUI is a Gradio-based browser interface for Whisper, serving as an Easy Subtitle Generator. It supports generating subtitles from various sources such as files, YouTube, and microphone. The tool also offers speech-to-text and text-to-text translation features, utilizing Facebook NLLB models and DeepL API. Users can translate subtitle files from other languages to English and vice versa. The project integrates faster-whisper for improved VRAM usage and transcription speed, providing efficiency metrics for optimized whisper models. Additionally, users can choose from different Whisper models based on size and language requirements.

humanoid-gym
Humanoid-Gym is a reinforcement learning framework designed for training locomotion skills for humanoid robots, focusing on zero-shot transfer from simulation to real-world environments. It integrates a sim-to-sim framework from Isaac Gym to Mujoco for verifying trained policies in different physical simulations. The codebase is verified with RobotEra's XBot-S and XBot-L humanoid robots. It offers comprehensive training guidelines, step-by-step configuration instructions, and execution scripts for easy deployment. The sim2sim support allows transferring trained policies to accurate simulated environments. The upcoming features include Denoising World Model Learning and Dexterous Hand Manipulation. Installation and usage guides are provided along with examples for training PPO policies and sim-to-sim transformations. The code structure includes environment and configuration files, with instructions on adding new environments. Troubleshooting tips are provided for common issues, along with a citation and acknowledgment section.

gpt4all
GPT4All is an ecosystem to run powerful and customized large language models that work locally on consumer grade CPUs and any GPU. Note that your CPU needs to support AVX or AVX2 instructions. Learn more in the documentation. A GPT4All model is a 3GB - 8GB file that you can download and plug into the GPT4All open-source ecosystem software. Nomic AI supports and maintains this software ecosystem to enforce quality and security alongside spearheading the effort to allow any person or enterprise to easily train and deploy their own on-edge large language models.

openroleplay.ai
Open Roleplay is an open-source alternative to Character.ai. It allows users to create their own AI characters, customize them, and generate images and voices for them. Open Roleplay also supports group chat and automatic translation. The tool is built with Next.js, React.js, Tailwind CSS, Vercel, Convex, and Clerk.

OpenAdapt
OpenAdapt is an open-source software adapter between Large Multimodal Models (LMMs) and traditional desktop and web Graphical User Interfaces (GUIs). It aims to automate repetitive GUI workflows by leveraging the power of LMMs. OpenAdapt records user input and screenshots, converts them into tokenized format, and generates synthetic input via transformer model completions. It also analyzes recordings to generate task trees and replay synthetic input to complete tasks. OpenAdapt is model agnostic and generates prompts automatically by learning from human demonstration, ensuring that agents are grounded in existing processes and mitigating hallucinations. It works with all types of desktop GUIs, including virtualized and web, and is open source under the MIT license.

xlang
XLang™ is a cutting-edge language designed for AI and IoT applications, offering exceptional dynamic and high-performance capabilities. It excels in distributed computing and seamless integration with popular languages like C++, Python, and JavaScript. Notably efficient, running 3 to 5 times faster than Python in AI and deep learning contexts. Features optimized tensor computing architecture for constructing neural networks through tensor expressions. Automates tensor data flow graph generation and compilation for specific targets, enhancing GPU performance by 6 to 10 times in CUDA environments.

openmeter
OpenMeter is a real-time and scalable usage metering tool for AI, usage-based billing, infrastructure, and IoT use cases. It provides a REST API for integrations and offers client SDKs in Node.js, Python, Go, and Web. OpenMeter is licensed under the Apache 2.0 License.

Easy-Translate
Easy-Translate is a script designed for translating large text files with a single command. It supports various models like M2M100, NLLB200, SeamlessM4T, LLaMA, and Bloom. The tool is beginner-friendly and offers seamless and customizable features for advanced users. It allows acceleration on CPU, multi-CPU, GPU, multi-GPU, and TPU, with support for different precisions and decoding strategies. Easy-Translate also provides an evaluation script for translations. Built on HuggingFace's Transformers and Accelerate library, it supports prompt usage and loading huge models efficiently.

GraphRAG-Local-UI
GraphRAG Local with Interactive UI is an adaptation of Microsoft's GraphRAG, tailored to support local models and featuring a comprehensive interactive user interface. It allows users to leverage local models for LLM and embeddings, visualize knowledge graphs in 2D or 3D, manage files, settings, and queries, and explore indexing outputs. The tool aims to be cost-effective by eliminating dependency on costly cloud-based models and offers flexible querying options for global, local, and direct chat queries.

codepair
CodePair is an open-source real-time collaborative markdown editor with AI intelligence, allowing users to collaboratively edit documents, share documents with external parties, and utilize AI intelligence within the editor. It is built using React, NestJS, and LangChain. The repository contains frontend and backend code, with detailed instructions for setting up and running each part. Users can choose between Frontend Development Only Mode or Full Stack Development Mode based on their needs. CodePair also integrates GitHub OAuth for Social Login feature. Contributors are welcome to submit patches and follow the contribution workflow.

ai-flow
AI Flow is an open-source, user-friendly UI application that empowers you to seamlessly connect multiple AI models together, specifically leveraging the capabilities of multiples AI APIs such as OpenAI, StabilityAI and Replicate. In a nutshell, AI Flow provides a visual platform for crafting and managing AI-driven workflows, thereby facilitating diverse and dynamic AI interactions.
For similar tasks

aiwechat-vercel
aiwechat-vercel is a tool that integrates AI capabilities into WeChat public accounts using Vercel functions. It requires minimal server setup, low entry barriers, and only needs a domain name that can be bound to Vercel, with almost zero cost. The tool supports various AI models, continuous Q&A sessions, chat functionality, system prompts, and custom commands. It aims to provide a platform for learning and experimentation with AI integration in WeChat public accounts.

Qbot
Qbot is an open-source project designed to help users quickly build their own QQ chatbot. The bot deployed using this project has various capabilities, including intelligent sentence segmentation, intent recognition, voice and drawing replies, autonomous selection of when to play local music, and decision-making on sending emojis. Qbot leverages other open-source projects and allows users to customize triggers, system prompts, chat models, and more through configuration files. Users can modify the Qbot.py source code to tailor the bot's behavior. The project requires NTQQ and LLonebot's NTQQ plugin for deployment, along with additional configurations for triggers, system prompts, and chat models. Users can start the bot by running Qbot.py after installing necessary libraries and ensuring the NTQQ is running. Qbot also supports features like sending music from the data/smusic folder and emojis based on emotions. Local voice synthesis can be deployed for voice outputs. Qbot provides commands like #reset to clear short-term memory and addresses common issues like program crashes due to encoding format, message sending/receiving failures, voice synthesis failures, and connection issues. Users are encouraged to give the project a star if they find it useful.

promptflow
**Prompt flow** is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, from ideation, prototyping, testing, evaluation to production deployment and monitoring. It makes prompt engineering much easier and enables you to build LLM apps with production quality.

unsloth
Unsloth is a tool that allows users to fine-tune large language models (LLMs) 2-5x faster with 80% less memory. It is a free and open-source tool that can be used to fine-tune LLMs such as Gemma, Mistral, Llama 2-5, TinyLlama, and CodeLlama 34b. Unsloth supports 4-bit and 16-bit QLoRA / LoRA fine-tuning via bitsandbytes. It also supports DPO (Direct Preference Optimization), PPO, and Reward Modelling. Unsloth is compatible with Hugging Face's TRL, Trainer, Seq2SeqTrainer, and Pytorch code. It is also compatible with NVIDIA GPUs since 2018+ (minimum CUDA Capability 7.0).

beyondllm
Beyond LLM offers an all-in-one toolkit for experimentation, evaluation, and deployment of Retrieval-Augmented Generation (RAG) systems. It simplifies the process with automated integration, customizable evaluation metrics, and support for various Large Language Models (LLMs) tailored to specific needs. The aim is to reduce LLM hallucination risks and enhance reliability.

hugging-chat-api
Unofficial HuggingChat Python API for creating chatbots, supporting features like image generation, web search, memorizing context, and changing LLMs. Users can log in, chat with the ChatBot, perform web searches, create new conversations, manage conversations, switch models, get conversation info, use assistants, and delete conversations. The API also includes a CLI mode with various commands for interacting with the tool. Users are advised not to use the application for high-stakes decisions or advice and to avoid high-frequency requests to preserve server resources.

microchain
Microchain is a function calling-based LLM agents tool with no bloat. It allows users to define LLM and templates, use various functions like Sum and Product, and create LLM agents for specific tasks. The tool provides a simple and efficient way to interact with OpenAI models and create conversational agents for various applications.

embedchain
Embedchain is an Open Source Framework for personalizing LLM responses. It simplifies the creation and deployment of personalized AI applications by efficiently managing unstructured data, generating relevant embeddings, and storing them in a vector database. With diverse APIs, users can extract contextual information, find precise answers, and engage in interactive chat conversations tailored to their data. The framework follows the design principle of being 'Conventional but Configurable' to cater to both software engineers and machine learning engineers.
For similar jobs

sweep
Sweep is an AI junior developer that turns bugs and feature requests into code changes. It automatically handles developer experience improvements like adding type hints and improving test coverage.

teams-ai
The Teams AI Library is a software development kit (SDK) that helps developers create bots that can interact with Teams and Microsoft 365 applications. It is built on top of the Bot Framework SDK and simplifies the process of developing bots that interact with Teams' artificial intelligence capabilities. The SDK is available for JavaScript/TypeScript, .NET, and Python.

ai-guide
This guide is dedicated to Large Language Models (LLMs) that you can run on your home computer. It assumes your PC is a lower-end, non-gaming setup.

classifai
Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence. Tap into leading cloud-based services like OpenAI, Microsoft Azure AI, Google Gemini and IBM Watson to augment your WordPress-powered websites. Publish content faster while improving SEO performance and increasing audience engagement. ClassifAI integrates Artificial Intelligence and Machine Learning technologies to lighten your workload and eliminate tedious tasks, giving you more time to create original content that matters.

chatbot-ui
Chatbot UI is an open-source AI chat app that allows users to create and deploy their own AI chatbots. It is easy to use and can be customized to fit any need. Chatbot UI is perfect for businesses, developers, and anyone who wants to create a chatbot.

BricksLLM
BricksLLM is a cloud native AI gateway written in Go. Currently, it provides native support for OpenAI, Anthropic, Azure OpenAI and vLLM. BricksLLM aims to provide enterprise level infrastructure that can power any LLM production use cases. Here are some use cases for BricksLLM: * Set LLM usage limits for users on different pricing tiers * Track LLM usage on a per user and per organization basis * Block or redact requests containing PIIs * Improve LLM reliability with failovers, retries and caching * Distribute API keys with rate limits and cost limits for internal development/production use cases * Distribute API keys with rate limits and cost limits for students

uAgents
uAgents is a Python library developed by Fetch.ai that allows for the creation of autonomous AI agents. These agents can perform various tasks on a schedule or take action on various events. uAgents are easy to create and manage, and they are connected to a fast-growing network of other uAgents. They are also secure, with cryptographically secured messages and wallets.

griptape
Griptape is a modular Python framework for building AI-powered applications that securely connect to your enterprise data and APIs. It offers developers the ability to maintain control and flexibility at every step. Griptape's core components include Structures (Agents, Pipelines, and Workflows), Tasks, Tools, Memory (Conversation Memory, Task Memory, and Meta Memory), Drivers (Prompt and Embedding Drivers, Vector Store Drivers, Image Generation Drivers, Image Query Drivers, SQL Drivers, Web Scraper Drivers, and Conversation Memory Drivers), Engines (Query Engines, Extraction Engines, Summary Engines, Image Generation Engines, and Image Query Engines), and additional components (Rulesets, Loaders, Artifacts, Chunkers, and Tokenizers). Griptape enables developers to create AI-powered applications with ease and efficiency.