Add your description here
Project description
📖 介绍
大语言模型的简单接入
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-nonechat
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-nonechat
打开 nonebot2 项目根目录下的 pyproject.toml
文件, 在 [tool.nonebot]
部分追加写入
plugins = ["nonebot_plugin_nonechat"]
🎉 使用
🚨 注意
- 目前只支持接入智谱清言的 glm 语言模型
理论上支持 chatgpt,我没 token 没测过 http(s)代理设置理论有效- glm 的 api key 请前往glm api key获取
🔧 插件配置
请在你的 bot 根目录下的.env
.env.*
中添加以下字段
字段 | 类型 | 默认值 | 可选值 | 描述 | 必填 |
---|---|---|---|---|---|
NONECHAT_MODEL | str | "glm-4-flash" | - | 插件使用的模型 | 否 |
NONECHAT_API_KEY | str | - | - | 你的 api key | 是 |
NONECHAT_BASE_URL | str | "https://open.bigmodel.cn/api/paas/v4/" | - | 调用的 llm api 接入点 | 否 |
NONECHAT_PROMPT | str | - | - | 使用的预设 | 否 |
NONECHAT_FILTER_WORDS | list[str] | [] | - | 对用户输入及 ai 输出内容的过滤 | 否 |
NONECHAT_MAX_TOKENS | int | 0 | - | 单次消息的最大 token 数,若为小于等于 0 的数则不做限制 | 否 |
NONECHAT_TEMPERATURE | float | 0.5 | - | 采样温度 | 否 |
NONECHAT_TIMEOUT | float | 60 | - | 响应的超时时间 | 否 |
NONECHAT_PROXY | str | - | - | 使用的 http(s)代理,格式为"{host}, {port}" | 否 |
✨ 功能介绍
- 在群聊里与接入的 LLM 进行对话
🚩 TODO
- 接入 openai 的 chatgpt 系列模型
- ai 绘图功能
- 获取生成的 markdown 图片的原始数据
- 多预设值的设置与选取
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
Close
Hashes for nonebot_plugin_nonechat-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d0e68777d84f66850464dfab55bfa13f300d5f2bdd1e486bb3f9760d940e76 |
|
MD5 | 20752cdfca9d0c899d6b9253f51a9214 |
|
BLAKE2b-256 | 45ceb08388e1dd885795ac404d0cf2405b7248461a89e5e283dcee21a6fe8531 |
Close
Hashes for nonebot_plugin_nonechat-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bf5727915f42641c433d8782bc54d93cf923410573701b2b74992c5dcd25323 |
|
MD5 | 2515a7d0341ce4d679ba3cb7d4a4911f |
|
BLAKE2b-256 | fa7212d0956c505b02cbb2c7bef0b26bac6d75c9b7333cbb0dda0b71862effcf |