基于 百度文心大模型 的 NoneBot2 promote索引文字生成插件
Project description
nonebot_plugin_writer
✨ 基于 百度文心大模型 的 NoneBot2 promote索引文字生成插件 ✨
修改自 nonebot-plugin-drawer 同时给我提供了非常多的思路
[百度文心大模型] https://wenxin.baidu.com/moduleApi/ernie3
一切开发旨在学习,请勿用于非法用途
侵权联系angjustin@163.com
前提: nonebot2的部署
[nonebot2 官方] https://nb2.baka.icu/
[昂昂bot的安装流程] https://github.com/ANGJustinl/ANGANGBOT/edit/main/README.md
[带佬提供的教程] https://zhuanlan.zhihu.com/p/371264976
| 使用未在其他环境编译的插件可能会遇到各种花里胡哨的麻烦,如果没有一些基础的话,前面可是困难重重啊少年
| 本文内容请您自行判断是否可信可靠可用,若您根据本文内容建立和使用AABT时出了任何问题和不良结果,鄙人概不负责。
| 安装流程 🚀
Ⅰ.通过nb-cli安装(推荐)
nb plugin install nonebot-plugin-drawer
Ⅱ.通过pip安装
1.pip install nonebot-plugin-writer 进行安装
2.在bot.py添加nonebot.load_plugin('nonebot_plugin_writrer')
Ⅲ.配置env.*
请在env.*配置文件中加入如下几行
wenxin_ak = "xxxxxxxxxxxxxxxx"
wenxin_sk = "xxxxxxxxxxxxxxxx"
wenxin_cd_time = 300 # 技能冷却时间,以秒为单位
wenxin_manager_list = ["123456789", "98765432"] # 管理员列表(不触发冷却时间限制)
文心的ak和sk申请链接:https://wenxin.baidu.com/younger/apiDetail?id=20008
| 使用方法(仅支持群聊)
触发菜单命令:写作帮助
当前支持 作文zuowen, 文案adtext, 摘要Summarization, 对联couplet, 自由问答PARAGRAPH, 小说novel, 补全文本cloze 如: PARAGRAPH 疯狂星期四v我50
| 非常重要的配置(动手能力强者自改)
详见插件安装目录
[nonebot_plugin_writer/writer.py]中20至30行
async def get_rst(input_text,input_len_max,input_topp,input_len_min,input_penalty,input_mode): input_dict = { "text": input_text, "seq_len": 512, "topp": 0.8, "penalty_score": 1.2, "min_dec_len": 128, "is_unidirectional": 0, "task_prompt": input_mode, "logits_bias": "-5" }
此段为文心模型input内容
具体命令及其用法详见 https://wenxin.baidu.com/wenxin/docs#dl6tgxw5f
可根据任务需求进行配置
| 👥反馈与交流
Issue for sure
QQ:77139032
群聊:696748432
mail:angjustin@163.com
bilibili:https://space.bilibili.com/213993950?spm_id_from=333.1007.0.0
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
File details
Details for the file nonebot_plugin_writer-0.2.1.tar.gz.
File metadata
- Download URL: nonebot_plugin_writer-0.2.1.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a8b4d98d6f61b05299d1bd754f6b68b1887b0360e853bda1c8f661ed1d21d36
|
|
| MD5 |
aecf50716f10383caac36ce71302f437
|
|
| BLAKE2b-256 |
b27739100b9f689f4a3a91902cbb6214d94651dd10803a57e508759e49a04a43
|