NoneBot DeepSeek 插件。接入 DeepSeek 模型,提供智能对话与问答功能
Project description
📖 介绍
NoneBot DeepSeek 插件。接入 DeepSeek 模型,提供智能对话与问答功能
Wiki: 👉 传送门
[!IMPORTANT] 收藏项目,你将从 GitHub 上无延迟地接收所有发布通知~⭐️
Star History
💿 安装
以下提到的方法任选 其一 即可
[!TIP] 想要启用 Markdown 转图片功能,需安装
nonebot-plugin-deepseek[image]
[推荐] 使用 nb-cli 安装
在 Bot 的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-deepseek
使用包管理器安装
pip install nonebot-plugin-deepseek
# or, use poetry
poetry add nonebot-plugin-deepseek
# or, use pdm
pdm add nonebot-plugin-deepseek
打开 NoneBot 项目根目录下的配置文件, 在 [plugin] 部分追加写入
plugins = ["nonebot_plugin_deepseek"]
⚙️ 配置
在项目的配置文件中添加下表中配置
[!note]
api_key请从 DeepSeek 开放平台 获取
enable_models为CustomModel结构的字典,若无接入本地模型的需要则无需修改
若要接入本地模型,请参见:👉 Wiki - 接入本地模型
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| deepseek__api_key | 是 | 无 | API Key |
| deepseek__enable_models | 否 | [{ "name": "deepseek-chat" }, { "name": "deepseek-reasoner" }] | 启用的模型 配置说明 |
| deepseek__prompt | 否 | 无 | 模型预设 |
| deepseek__stream | 否 | False | 是否启用流式传输 |
| deepseek__timeout | 否 | {"api_request": 100, "user_input": 60} | 超时设定 |
| deepseek__md_to_pic | 否 | False | 是否启用 Markdown 转图片 |
| deepseek__enable_send_thinking | 否 | False | 是否发送思维链 |
🎉 使用
[!note] 请检查你的
COMMAND_START以及上述配置项。这里默认使用/
帮助
deepseek --help
--balance
[...content]
--use-model [model]
--with-context
--render | -r
model
--list | -l
--set-default [model]
--render-markdown ['enable' | 'disable' | 'on' | 'off']
问答
/deepseek [内容]
快捷命令:/ds [内容] 或回复文本消息
多轮对话
/deepseek --with-context [内容]
快捷指令:/ds --with-context [内容] /多轮对话
深度思考
/deepseek [内容] --use-model deepseek-reasoner
快捷指令:/深度思考 [内容]
余额
权限:SUPERUSER
/deepseek --balance
快捷指令:/ds --balance /余额
设置
权限:
设置默认模型指令仅 SUPERUSER 可用
# 查看支持的模型列表
/deepseek model -l|--list
# 设置默认模型
/deepseek model --set-default [模型名]
# 设置 Markdown 转图片
/deepseek model --render-markdown ['enable' | 'disable' | 'on' | 'off']
快捷指令:/模型列表 /设置默认模型 [模型名]
自定义快捷指令
该特性依赖于 Alconna 快捷指令。自定义指令不带
COMMAND_START,若有必要需手动填写
# 增加
/deepseek --shortcut <自定义指令> /deepseek
# 删除
/deepseek --shortcut delete <自定义指令>
# 列出
/deepseek --shortcut list
例子:
user: /deepseek --shortcut /chat /deepseek --use-model deepseek-chat
bot: deepseek::deepseek 的快捷指令: "/chat" 添加成功
user: /chat
bot: (使用模型 deepseek-chat)
📸 效果图
💖 鸣谢
KomoriDev/Starify:提供了引人注目的徽章
贡献者们
感谢这些大佬对本项目作出的贡献:
📄 许可证
本项目使用 MIT 许可证开源
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
Release history Release notifications | RSS feed
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_deepseek-0.1.10.tar.gz.
File metadata
- Download URL: nonebot_plugin_deepseek-0.1.10.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.4 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8040a41925e46216561bee71bf853f19ad258c6ce39459ab9d6b0cce7bbf0932
|
|
| MD5 |
43a106f6031a1ab39ae295a4dec794a8
|
|
| BLAKE2b-256 |
1b811cbe1b8cbd1f8b3370607967ef508bf04a93800af6ae422ae27c4042d14c
|
File details
Details for the file nonebot_plugin_deepseek-0.1.10-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_deepseek-0.1.10-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.4 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a651e2f69c1753d519392a55206af3ca757075c813aa2375e5180249a15a0377
|
|
| MD5 |
967e389b5205658ba0e32520054651d2
|
|
| BLAKE2b-256 |
9db86319e4f4196280b5060561ff54209accf3c3b5f8b57ec49df63536efc6d1
|