Skip to main content
logo

nonebot-plugin-nonechat

License PyPI NoneBot Python

📖 介绍

大语言模型的简单接入

💿 安装

使用 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 图片的原始数据
  • 多预设值的设置与选取
  • 私聊支持

Metadata

Release files for nonebot-plugin-nonechat 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-nonechat 0.1.2
File Size Uploaded
nonebot_plugin_nonechat-0.1.2.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-nonechat 0.1.2
File Interpreter ABI Platform
nonebot_plugin_nonechat-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / nonebot_plugin_nonechat-0.1.2.tar.gz

Download URL nonebot_plugin_nonechat-0.1.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9c39f6f246e023961a24a2bc8ee4632de4daa65283533a498c97ac18e581506e
BLAKE2b-256 checksum
How to use checksums
5638f279bfb247b96f5665067e2b24818a56bfd96b9665d790c58c97ef327803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / nonebot_plugin_nonechat-0.1.2-py3-none-any.whl

Download URL nonebot_plugin_nonechat-0.1.2-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d662d49e9614345bd76b345bf7f92961ef39766839c3707ad01e0c1b3738414
BLAKE2b-256 checksum
How to use checksums
8ba6ce891206ddbdc17c2b24004188e904c54cc8ac0582ac63e6e48ec4adc540
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page