介绍
- 本插件基于OpenAI的API开发,在nonebot框架下实现一个AI生成指定主题PPT的文件并上传到群文件中。
安装
-
手动安装
git clone https://github.com/Alpaca4610/nonebot-plugin-chatppt.git下载完成后在bot项目的pyproject.toml文件手动添加插件:
plugin_dirs = ["xxxxxx","xxxxxx",......,"下载完成的插件路径/nonebot-plugin-chatppt"] -
使用 pip
pip install nonebot-plugin-chatppt
配置文件
在Bot根目录下的.env文件中追加如下内容:
OPENAI_API_KEY = key
可选内容:
OPENAI_HTTP_PROXY = "http://127.0.0.1:8001" # 中国大陆/香港IP调用API请使用代理访问api,否则有几率会被封禁
OPENAI_MODEL_NAME = "xxxxx" # 使用的模型名称
SLIDES_LIMIT = "xxxxx" # 生成PPT页数的上限,不设置默认为10
使用方法
- 配置PPT模版文件
在Bot目录下的data文件夹里面新建nonebot-plugin-chatppt/theme文件夹。把PPT主题模版文件放进里面,支持多文件。
- 生成PPT命令
chatppt
- 删除当前用户缓存文件命令
删除缓存PPT
- 删除所有用户缓存文件命令
删除所有缓存PPT
Todo
- 多模版支持
- 优化生成内容
- 完善插入图片功能
核心代码
Metadata
Release files for nonebot-plugin-chatppt 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_chatppt-0.1.1.tar.gz | 6.5 kB | Without provenance | Details for nonebot_plugin_chatppt-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_chatppt-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_chatppt-0.1.1-py3-none-any.whl |
Total release size: 13.3 kB
Release files / nonebot_plugin_chatppt-0.1.1.tar.gz
| Download URL | nonebot_plugin_chatppt-0.1.1.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
146daeab762524ea3b3d59da63cf9eeee4d728da626f7d5c3cf1095d46a1fdab
|
|
BLAKE2b-256 checksum How to use checksums |
dabc17af7f528cd9bddf56eb19409c6642837b61e20cf6fcc1ad26a4225e802a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.6 Darwin/22.4.0
|
Release files / nonebot_plugin_chatppt-0.1.1-py3-none-any.whl
| Download URL | nonebot_plugin_chatppt-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23a4f139f34757bd115c4d5ab4332f3f7ceecb0b808618c652194fe1545a9d66
|
|
BLAKE2b-256 checksum How to use checksums |
1d19662aecdf764d8adcd1b30b653bd0817652f3b80d403f37510bc6204e8839
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.6 Darwin/22.4.0
|
Security for nonebot-plugin-chatppt 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.