Skip to main content

NoneBot2 一个模板绘图插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-templates-draw

✨ NoneBot2 一个模板绘图插件 ✨

license pypi python

📖 介绍

基于Gemini API 的模板绘图插件 前身是 nonebot-plugin-figurine 进行了全面升级

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-templates-draw
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-templates-draw
pdm
pdm add nonebot-plugin-templates-draw
poetry
poetry add nonebot-plugin-templates-draw
conda
conda install nonebot-plugin-templates-draw

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_templates_draw"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
TEMPLATES_DRAW__GEMINI_API_URL https://generativelanguage.googleapis.com/v1beta 看下方注释
TEMPLATES_DRAW__GEMINI_API_KEYS ["xxxxxx"] 需要付费key,填入你的多个API Key,例如 ['key1', 'key2', 'key3']
TEMPLATES_DRAW__GEMINI_MODEL gemini-2.5-flash-image-preview Gemini 模型 默认为 gemini-2.5-flash-image-preview
TEMPLATES_DRAW__MAX_TOTAL_ATTEMPTS 2 这一张图的最大尝试次数(包括首次尝试),默认2次,建议不小于Key数量,保证每个Key至少轮到1次
TEMPLATES_DRAW__SEND_FORWARD_MSG True 使用合并转发来发图,默认开启
TEMPLATES_DRAW__JAILBREAK_PROMPT - 看下方注释
  • Gemini API Url 默认为官方完整 Url,可以替换为中转 https://xxxxx.xxx/v1beta 如果想使用 OpenAI 兼容层(不推荐),可以替换为 https://generativelanguage.googleapis.com/v1beta/openai 或者中转 https://xxxxx.xxx/v1/chat/completions
  • </code></pre>
    </li>
    <li>放弃了JAILBREAK_PROMPT,使用上下文破限</li>
    </ul>
    <h3>推荐API</h3>
    <ul>
    <li><a href="https://openrouter.ai/">https://openrouter.ai/</a> <del>充值10刀即可每天调用1000次免费模型</del></li>
    <li>由于Google改变了价格,不再有免费调用:<a href="https://ai.google.dev/gemini-api/docs/pricing?hl=zh-cn#gemini-2.5-flash-image-preview">https://ai.google.dev/gemini-api/docs/pricing?hl=zh-cn#gemini-2.5-flash-image-preview</a></li>
    <li>1次调用不到4毛CNY,建议配合 <a href="https://github.com/HibiKier/nonebot-plugin-zxpm">插件管理系统</a> 等设置阻塞、CD、次数</li>
    <li>自建API:覆盖如下请求参数</li>
    </ul>
    <pre><code>{
      "modalities": [
        "image",
        "text"
      ]
    }
    
    • 最新API:柏拉图AI

    🎉 使用

    指令表

    指令 权限 需要@ 范围 说明
    画图 群员 群聊 需要带图或回复图片或@某人
    查看模板 群员 群聊 查看模板 或者 查看模板 <模板标识>
    添加/删除模板 群员 群聊 格式:添加模板 <模板标识> <提示词>
    • 默认提示词已经写入config,不可修改,可以通过用户模板覆盖同名模板

    鸣谢

    感谢真寻以及真寻群友提供的灵感

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_templates_draw-1.4.7.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_templates_draw-1.4.7-py3-none-any.whl (3.3 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_templates_draw-1.4.7.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_templates_draw-1.4.7.tar.gz
Algorithm Hash digest
SHA256 997af2f1eb9484c62dd24581627e466c1578e646b5a4a2b16e0ac63102873379
MD5 8c3f0fb43679b8652f06210d7bc710cb
BLAKE2b-256 9a660025bdd75e0e879c465cc305550aaf876029cd74bcdfdf590fa161f94f3d

See more details on using hashes here.

File details

Details for the file nonebot_plugin_templates_draw-1.4.7-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_templates_draw-1.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 45a324940481d5d211cc6f54371f17d6dee46a1b99c77577affd74f5de9a1f18
MD5 2a874b1fe1b11ab023a599fe813df7d8
BLAKE2b-256 0a2ec230bd1a89446f4143e2c173f2f7b5aff2b484b75c7809480dbffa006c18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page