<div align="center">
<a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
<br>
<p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>
<div align="center">
# nonebot-plugin-furrybar
_✨ furrybar API 对接插件 ✨_
</a>
<a href="https://github.com/huilongxiji/nonebot-plugin-furrybar/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/huilongxiji/nonebot-plugin-furrybar.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot-plugin-furrybar">
<img src="https://img.shields.io/pypi/v/nonebot-plugin-furrybar.svg" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="python">
</div>
基于NoneBot2进行适配的ai对话聊天插件,适合做赛博龙龙……?
## 📖 介绍
本插件使用标准的<a href="https://openai.xiniushu.com/docs/guides/chat"> openai API格式 </a>进行编写,主要为furrybar api进行服务,同时也兼容了所有openai标准的api,方便用户在更加灵活的选择api。安装之后需要填好相应的全局配置项,以保证该模块的正常运行,具体配置填法请见配置板块。
本模块作为bot插件,仅接受学习代码结构以及了解openai标准格式的纯本地构建形式。
若本插件存在bug欢迎各位反馈!!!
目前只支持 onebotV11 暂时还未上传nonebot商店
## 💿 安装
<details open>
<summary>使用PIP安装</summary>
在 nonebot2 项目的插件目录下, 打开命令行, 输入安装命令
```
pip install nonebot-plugin-furrybar
```
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
```
plugins = ["nonebot-plugin-furrybar"]
```
</details>
## ⚙️ 配置
在 nonebot2 项目的`.env`文件中添加下表中的配置,不填任何配置则自动使用默认账户
```
# 这里是设置模块默认状态的,可选True或者False
Private = True
# 你的api地址
api_url = "你获得的api地址"
# 你的apikey
api_key = "你获得的token"
# 你的人格设定
prompt = "人格设定"
# 你的对话预设
yushe = [
{"role":"user","content":"戳戳"},
{"role":"assistant","content":"干嘛?(歪头)"}
]
# 你的模型列表
furrybar_model_list = ["xxx","xxx"]
# 你的控制台群号(不填则不发送报错至控制台)
kongzhitai = 1234567
```
## 🎉 使用
### 指令表
| 指令 | 权限 | 是否需要参数 | 说明 |
| :-------------: | :--------------: | :---------------: | :--------------------------------: |
| @ | 群员 | 需要艾特 | 艾特bot直接与ai对话 |
| /ai | 超管/群主/管理员 | 后面带on或者off | 开启或关闭当前群聊的ai对话 |
| /拉黑 | 超级管理员 | 需要携带对方q账号 | 拉黑对应用户 |
| /切换模型 | 超级管理员 | 根据id切换模型 | 动态加载模型列表,用来切换当前模型 |
| /模型调用数据 | 超级管理员 | 不需要 | 查看ai对话调用次数以及故障次数 |
| /登记信息 | 所有人 | 不需要 | 流程式对话登记用户信息 |
| (开启/关闭)私聊 | 私聊使用 | 不需要 | 开启私聊对话功能 |
## 插件完成度
目前进度:
- [x] 模型切换
- [x] 黑名单功能
- [x] 调用记录
- [x] 个人信息登记(让ai记住你是谁)
- [x] 本地知识库
- [ ] bot默认状态设置
- [ ] 分别查询用户使用热度
- [ ] 用户对话词云
- [ ] 自由切换api和key来适配多api情况
Raw data
{
"_id": null,
"home_page": "https://github.com/huilongxiji/nonebot-plugin-furrybar",
"name": "nonebot-plugin-furrybar",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "huilongxiji",
"author_email": "huilongxiji <2601515849@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/36/56/17c078897c647bcbf92e6ee0ef4b8c4c448ff55bac10e29e7c578fa9faa1/nonebot_plugin_furrybar-1.6.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\r\n <br>\r\n <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\r\n</div>\r\n\r\n<div align=\"center\">\r\n\r\n# nonebot-plugin-furrybar\r\n\r\n_\u2728 furrybar API \u5bf9\u63a5\u63d2\u4ef6 \u2728_\r\n\r\n</a>\r\n<a href=\"https://github.com/huilongxiji/nonebot-plugin-furrybar/blob/main/LICENSE\">\r\n <img src=\"https://img.shields.io/github/license/huilongxiji/nonebot-plugin-furrybar.svg\" alt=\"license\">\r\n</a>\r\n<a href=\"https://pypi.python.org/pypi/nonebot-plugin-furrybar\">\r\n <img src=\"https://img.shields.io/pypi/v/nonebot-plugin-furrybar.svg\" alt=\"pypi\">\r\n</a>\r\n<img src=\"https://img.shields.io/badge/python-3.9+-blue.svg\" alt=\"python\">\r\n\r\n</div>\r\n\r\n\u57fa\u4e8eNoneBot2\u8fdb\u884c\u9002\u914d\u7684ai\u5bf9\u8bdd\u804a\u5929\u63d2\u4ef6\uff0c\u9002\u5408\u505a\u8d5b\u535a\u9f99\u9f99\u2026\u2026\uff1f\r\n\r\n## \ud83d\udcd6 \u4ecb\u7ecd\r\n\r\n\u672c\u63d2\u4ef6\u4f7f\u7528\u6807\u51c6\u7684<a href=\"https://openai.xiniushu.com/docs/guides/chat\"> openai API\u683c\u5f0f </a>\u8fdb\u884c\u7f16\u5199\uff0c\u4e3b\u8981\u4e3afurrybar api\u8fdb\u884c\u670d\u52a1\uff0c\u540c\u65f6\u4e5f\u517c\u5bb9\u4e86\u6240\u6709openai\u6807\u51c6\u7684api\uff0c\u65b9\u4fbf\u7528\u6237\u5728\u66f4\u52a0\u7075\u6d3b\u7684\u9009\u62e9api\u3002\u5b89\u88c5\u4e4b\u540e\u9700\u8981\u586b\u597d\u76f8\u5e94\u7684\u5168\u5c40\u914d\u7f6e\u9879\uff0c\u4ee5\u4fdd\u8bc1\u8be5\u6a21\u5757\u7684\u6b63\u5e38\u8fd0\u884c\uff0c\u5177\u4f53\u914d\u7f6e\u586b\u6cd5\u8bf7\u89c1\u914d\u7f6e\u677f\u5757\u3002\r\n\u672c\u6a21\u5757\u4f5c\u4e3abot\u63d2\u4ef6\uff0c\u4ec5\u63a5\u53d7\u5b66\u4e60\u4ee3\u7801\u7ed3\u6784\u4ee5\u53ca\u4e86\u89e3openai\u6807\u51c6\u683c\u5f0f\u7684\u7eaf\u672c\u5730\u6784\u5efa\u5f62\u5f0f\u3002\r\n\u82e5\u672c\u63d2\u4ef6\u5b58\u5728bug\u6b22\u8fce\u5404\u4f4d\u53cd\u9988\uff01\uff01\uff01\r\n\u76ee\u524d\u53ea\u652f\u6301 onebotV11 \u6682\u65f6\u8fd8\u672a\u4e0a\u4f20nonebot\u5546\u5e97\r\n\r\n## \ud83d\udcbf \u5b89\u88c5\r\n\r\n<details open>\r\n<summary>\u4f7f\u7528PIP\u5b89\u88c5</summary>\r\n\u5728 nonebot2 \u9879\u76ee\u7684\u63d2\u4ef6\u76ee\u5f55\u4e0b, \u6253\u5f00\u547d\u4ee4\u884c, \u8f93\u5165\u5b89\u88c5\u547d\u4ee4\r\n\r\n```\r\npip install nonebot-plugin-furrybar\r\n```\r\n\r\n\u6253\u5f00 nonebot2 \u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684 `pyproject.toml` \u6587\u4ef6, \u5728 `[tool.nonebot]` \u90e8\u5206\u8ffd\u52a0\u5199\u5165\r\n\r\n```\r\nplugins = [\"nonebot-plugin-furrybar\"]\r\n```\r\n\r\n</details>\r\n\r\n## \u2699\ufe0f \u914d\u7f6e\r\n\r\n\u5728 nonebot2 \u9879\u76ee\u7684`.env`\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e0b\u8868\u4e2d\u7684\u914d\u7f6e\uff0c\u4e0d\u586b\u4efb\u4f55\u914d\u7f6e\u5219\u81ea\u52a8\u4f7f\u7528\u9ed8\u8ba4\u8d26\u6237\r\n\r\n```\r\n# \u8fd9\u91cc\u662f\u8bbe\u7f6e\u6a21\u5757\u9ed8\u8ba4\u72b6\u6001\u7684\uff0c\u53ef\u9009True\u6216\u8005False\r\nPrivate = True\r\n# \u4f60\u7684api\u5730\u5740\r\napi_url = \"\u4f60\u83b7\u5f97\u7684api\u5730\u5740\"\r\n# \u4f60\u7684apikey\r\napi_key = \"\u4f60\u83b7\u5f97\u7684token\"\r\n# \u4f60\u7684\u4eba\u683c\u8bbe\u5b9a\r\nprompt = \"\u4eba\u683c\u8bbe\u5b9a\"\r\n# \u4f60\u7684\u5bf9\u8bdd\u9884\u8bbe\r\nyushe = [\r\n {\"role\":\"user\",\"content\":\"\u6233\u6233\"},\r\n {\"role\":\"assistant\",\"content\":\"\u5e72\u561b\uff1f\uff08\u6b6a\u5934\uff09\"}\r\n]\r\n# \u4f60\u7684\u6a21\u578b\u5217\u8868\r\nfurrybar_model_list = [\"xxx\",\"xxx\"]\r\n# \u4f60\u7684\u63a7\u5236\u53f0\u7fa4\u53f7\uff08\u4e0d\u586b\u5219\u4e0d\u53d1\u9001\u62a5\u9519\u81f3\u63a7\u5236\u53f0\uff09\r\nkongzhitai = 1234567\r\n```\r\n\r\n## \ud83c\udf89 \u4f7f\u7528\r\n\r\n### \u6307\u4ee4\u8868\r\n\r\n| \u6307\u4ee4 | \u6743\u9650 | \u662f\u5426\u9700\u8981\u53c2\u6570 | \u8bf4\u660e |\r\n| :-------------: | :--------------: | :---------------: | :--------------------------------: |\r\n| @ | \u7fa4\u5458 | \u9700\u8981\u827e\u7279 | \u827e\u7279bot\u76f4\u63a5\u4e0eai\u5bf9\u8bdd |\r\n| /ai | \u8d85\u7ba1/\u7fa4\u4e3b/\u7ba1\u7406\u5458 | \u540e\u9762\u5e26on\u6216\u8005off | \u5f00\u542f\u6216\u5173\u95ed\u5f53\u524d\u7fa4\u804a\u7684ai\u5bf9\u8bdd |\r\n| /\u62c9\u9ed1 | \u8d85\u7ea7\u7ba1\u7406\u5458 | \u9700\u8981\u643a\u5e26\u5bf9\u65b9q\u8d26\u53f7 | \u62c9\u9ed1\u5bf9\u5e94\u7528\u6237 |\r\n| /\u5207\u6362\u6a21\u578b | \u8d85\u7ea7\u7ba1\u7406\u5458 | \u6839\u636eid\u5207\u6362\u6a21\u578b | \u52a8\u6001\u52a0\u8f7d\u6a21\u578b\u5217\u8868\uff0c\u7528\u6765\u5207\u6362\u5f53\u524d\u6a21\u578b |\r\n| /\u6a21\u578b\u8c03\u7528\u6570\u636e | \u8d85\u7ea7\u7ba1\u7406\u5458 | \u4e0d\u9700\u8981 | \u67e5\u770bai\u5bf9\u8bdd\u8c03\u7528\u6b21\u6570\u4ee5\u53ca\u6545\u969c\u6b21\u6570 |\r\n| /\u767b\u8bb0\u4fe1\u606f | \u6240\u6709\u4eba | \u4e0d\u9700\u8981 | \u6d41\u7a0b\u5f0f\u5bf9\u8bdd\u767b\u8bb0\u7528\u6237\u4fe1\u606f |\r\n| (\u5f00\u542f/\u5173\u95ed)\u79c1\u804a | \u79c1\u804a\u4f7f\u7528 | \u4e0d\u9700\u8981 | \u5f00\u542f\u79c1\u804a\u5bf9\u8bdd\u529f\u80fd |\r\n\r\n## \u63d2\u4ef6\u5b8c\u6210\u5ea6\r\n\r\n\u76ee\u524d\u8fdb\u5ea6:\r\n\r\n- [x] \u6a21\u578b\u5207\u6362\r\n- [x] \u9ed1\u540d\u5355\u529f\u80fd\r\n- [x] \u8c03\u7528\u8bb0\u5f55\r\n- [x] \u4e2a\u4eba\u4fe1\u606f\u767b\u8bb0\uff08\u8ba9ai\u8bb0\u4f4f\u4f60\u662f\u8c01\uff09\r\n- [x] \u672c\u5730\u77e5\u8bc6\u5e93\r\n- [ ] bot\u9ed8\u8ba4\u72b6\u6001\u8bbe\u7f6e\r\n- [ ] \u5206\u522b\u67e5\u8be2\u7528\u6237\u4f7f\u7528\u70ed\u5ea6\r\n- [ ] \u7528\u6237\u5bf9\u8bdd\u8bcd\u4e91\r\n- [ ] \u81ea\u7531\u5207\u6362api\u548ckey\u6765\u9002\u914d\u591aapi\u60c5\u51b5\r\n\r\n",
"bugtrack_url": null,
"license": "GPL-3.0 license",
"summary": "\u57fa\u4e8eNoneBot2\u8fdb\u884c\u9002\u914d\u7684ai\u5bf9\u8bdd\u63d2\u4ef6",
"version": "1.6.0",
"project_urls": {
"Bug Tracker": "https://github.com/huilongxiji/nonebot-plugin-furrybar/issues",
"Homepage": "https://github.com/huilongxiji"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cd7d0417dbded657337f0f855741924d31b3825806a37d6acd387d3ff2c0fa2d",
"md5": "692f02c25ee2e3cbc3271376b1c57fe1",
"sha256": "673478423b417048a8f1aa4b58177b0b2d0299040eb5bf529f1bae555c30dc5f"
},
"downloads": -1,
"filename": "nonebot_plugin_furrybar-1.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "692f02c25ee2e3cbc3271376b1c57fe1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 26857,
"upload_time": "2024-12-23T14:15:26",
"upload_time_iso_8601": "2024-12-23T14:15:26.536060Z",
"url": "https://files.pythonhosted.org/packages/cd/7d/0417dbded657337f0f855741924d31b3825806a37d6acd387d3ff2c0fa2d/nonebot_plugin_furrybar-1.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "365617c078897c647bcbf92e6ee0ef4b8c4c448ff55bac10e29e7c578fa9faa1",
"md5": "8b9e1fb52878b62c200d83f8bea6e841",
"sha256": "811a32ddf3761ed61a7508f076ae3071e03eeaf45eee7636da7e276df3b28300"
},
"downloads": -1,
"filename": "nonebot_plugin_furrybar-1.6.0.tar.gz",
"has_sig": false,
"md5_digest": "8b9e1fb52878b62c200d83f8bea6e841",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 27230,
"upload_time": "2024-12-23T14:15:29",
"upload_time_iso_8601": "2024-12-23T14:15:29.145406Z",
"url": "https://files.pythonhosted.org/packages/36/56/17c078897c647bcbf92e6ee0ef4b8c4c448ff55bac10e29e7c578fa9faa1/nonebot_plugin_furrybar-1.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-23 14:15:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "huilongxiji",
"github_project": "nonebot-plugin-furrybar",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nonebot-plugin-furrybar"
}