ai 群友
Project description
📖 介绍
本插件主体使用使用 langchain 的 agent 进行决策,由 langchain 调用 tools 进行一系列任务。
tools 中包含 RAG ,可以自动对聊天历史储存,储存长记忆。学习群内群友发言习惯,使得 bot 更像真人。
对于群内的表情包,使用了 vlm + clip 模型,自动从群内学习并偷取表情包,然后从向量库内选取合适表情包进行回答。
对于模型选择方面:推荐使用 glm-4.6 模型,以及本地部署 qwen3-vl 作为 vlm 模型,如果 embedding、 rerank、vlm 和 clip 模型都使用了显卡加速的话,大约需要 16G 显存的显卡。若只有 8G 显存,将 vlm 模型调整为 api 调用的话,就可以流畅使用了。
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-ai-groupmate --upgrade
使用 pypi 源安装
nb plugin install nonebot-plugin-ai-groupmate --upgrade -i "https://pypi.org/simple"
使用清华源安装
nb plugin install nonebot-plugin-ai-groupmate --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令uv
uv add nonebot-plugin-ai-groupmate
安装仓库 master 分支
uv add git+https://github.com/yaowan233/nonebot-plugin-ai-groupmate@master
pdm
pdm add nonebot-plugin-ai-groupmate
安装仓库 master 分支
pdm add git+https://github.com/yaowan233/nonebot-plugin-ai-groupmate@master
poetry
poetry add nonebot-plugin-ai-groupmate
安装仓库 master 分支
poetry add git+https://github.com/yaowan233/nonebot-plugin-ai-groupmate@master
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = [nonebot-plugin-ai-groupmate"]
使用 nbr 安装(使用 uv 管理依赖可用)
nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2
nbr plugin install nonebot-plugin-ai-groupmate
使用 pypi 源安装
nbr plugin install nonebot-plugin-ai-groupmate -i "https://pypi.org/simple"
使用清华源安装
nbr plugin install nonebot-plugin-ai-groupmate -i "https://pypi.tuna.tsinghua.edu.cn/simple"
⚙️ 配置
配置说明
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| ai_groupmate__bot_name | 是 | 无 | bot 名 |
| ai_groupmate__reply_probability | 否 | 0.01 | 群内发言概率 |
| ai_groupmate__personality_setting | 否 | 无 | 自定义人设 |
| ai_groupmate__milvus_uri | 否 | 无 | milvus 地址 |
| ai_groupmate__milvus_user | 否 | 无 | milvus 用户名 |
| ai_groupmate__milvus_password | 否 | 无 | milvus 密码 |
| ai_groupmate__tavily_api_key | 否 | 无 | tavily api 密钥 |
| ai_groupmate__openai_base_url | 否 | 无 | openai 请求地址 |
| ai_groupmate__openai_token | 否 | 无 | openai token |
| ai_groupmate__openai_model | 否 | 无 | openai 模型名 |
| ai_groupmate__vlm_ollama_base_url | 否 | 无 | vlm 地址 |
| ai_groupmate__vlm_model | 否 | 无 | vlm 模型名 |
| ai_groupmate__vlm_provider | 否 | ollama | ollama 或 openai |
| ai_groupmate__vlm_openai_base_url | 否 | 无 | vlm openai 请求地址 |
| ai_groupmate__vlm_openai_api_key | 否 | 无 | vlm openai api key |
🎉 使用
ai会自动偷群内使用的表情包,增加至向量库当中,在回答时通过向量库内容搜索表情包,由于使用了vlm模型,搜索的准确率十分高。
内置了好感度系统,增加了趣味性。
利用强大的 RAG,进行总结或进行任何检索聊天相关功能。
发送群内偷学到的表情包
指令表
由于 AI 功能需要记录聊天记录,基于已记录的聊天记录,可以很轻松的做到词频统计,所以顺带加上了。
| 指令 | 说明 |
|---|---|
| /词频 <统计天数> | 生成个人词频词云 |
| /群词频 <统计天数> | 生成群词频词云 |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_ai_groupmate-1.1.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_ai_groupmate-1.1.0.tar.gz
- Upload date:
- Size: 7.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2fe3be0ec6c58d4b1d78cf996eb04333ca216f5a82c50278879e1b1ab772bc9
|
|
| MD5 |
52253eb0389126bf84b0c980e27d8cab
|
|
| BLAKE2b-256 |
49690a18eeca82f0496a8d74ae6ede5520f619c037f44b1087d8830ca9a2c0ce
|
Provenance
The following attestation bundles were made for nonebot_plugin_ai_groupmate-1.1.0.tar.gz:
Publisher:
release.yml on yaowan233/nonebot-plugin-ai-groupmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_ai_groupmate-1.1.0.tar.gz -
Subject digest:
e2fe3be0ec6c58d4b1d78cf996eb04333ca216f5a82c50278879e1b1ab772bc9 - Sigstore transparency entry: 820596674
- Sigstore integration time:
-
Permalink:
yaowan233/nonebot-plugin-ai-groupmate@132e38540ca2267658f1ed096ee6c81c59935eb7 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/yaowan233
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@132e38540ca2267658f1ed096ee6c81c59935eb7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_ai_groupmate-1.1.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_ai_groupmate-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
509852e64c571416a900a62abc6e13e83aa544382fefb5d510fc72f953ebe2bf
|
|
| MD5 |
f00c2973afcb98069d032e3999e2fa8e
|
|
| BLAKE2b-256 |
d5447d4591722ec4fcb5d7cd133ab83535cc2ca11a6731b6337dd314effe5552
|
Provenance
The following attestation bundles were made for nonebot_plugin_ai_groupmate-1.1.0-py3-none-any.whl:
Publisher:
release.yml on yaowan233/nonebot-plugin-ai-groupmate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_ai_groupmate-1.1.0-py3-none-any.whl -
Subject digest:
509852e64c571416a900a62abc6e13e83aa544382fefb5d510fc72f953ebe2bf - Sigstore transparency entry: 820596677
- Sigstore integration time:
-
Permalink:
yaowan233/nonebot-plugin-ai-groupmate@132e38540ca2267658f1ed096ee6c81c59935eb7 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/yaowan233
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@132e38540ca2267658f1ed096ee6c81c59935eb7 -
Trigger Event:
push
-
Statement type: