Skip to main content
NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-bard

介绍

  • 本插件是适配Google Gemini网页版的聊天机器人插件,借助Gemini Pro的联网能力和多模态识别能力实现更准确地回复和图片识别回复等功能。
  • 核心代码源于Gemini-API,本插件修改了其中部分内容以兼容其他插件的依赖版本。
  • 由于历史原因,本插件的名称为nonebot-plugin-bard。
  • Gemini Pro的联网能力
  • Gemini Pro的多模态识别能力

安装

  • 手动安装

    git clone https://github.com/Alpaca4610/nonebot_plugin_bard.git
    

    下载完成后在bot项目的pyproject.toml文件手动添加插件:

    plugin_dirs = ["xxxxxx","xxxxxx",......,"下载完成的插件路径/nonebot_plugin_bard"]
    
  • 使用 pip

    pip install nonebot-plugin-bard
    

配置文件

必选内容

在Bot根目录下的.env文件中填入Bard的cookies信息:

gemini_token1 = xxxxxxxx  # __Secure_1PSID的值
gemini_token2 = xxxxxxxx  # __Secure_1PSIDTS的值

cookies获取方法

  1. 确保您已经拥有bard的访问权限
  2. 访问 https://gemini.google.com/
  3. 按 F12 打开控制台,进入应用程序(Application) → Cookies → 复制相应cookies的值
  4. cookies过一段时间可能会失效,如有报错更新即可

可选内容:

bard_enable_private_chat = True   # 私聊开关,默认开启,改为False关闭
bard_proxy = "127.0.0.1:8001"    # 配置代理访问Bard

使用方法

  • Gemini 文字/图片 发起无记忆对话
  • 连续对话 文字/图片 发起有记忆对话
  • 结束连续对话 结束有记忆对话
  • 清除记忆 管理员命令,删除所有连续对话的记忆

Gemini插件使用

在文字中添加@插件名(如@Youtube)可以调用Gemini网页版支持的插件 Gemini Pro的youtube搜视频插件

Release files for nonebot-plugin-bard 0.5.1

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-bard 0.5.1
File Size Uploaded
nonebot_plugin_bard-0.5.1.tar.gz 437.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-bard 0.5.1
File Interpreter ABI Platform
nonebot_plugin_bard-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 875.9 kB

Release files / nonebot_plugin_bard-0.5.1.tar.gz

Download URL nonebot_plugin_bard-0.5.1.tar.gz
Size 437.3 kB
Tags Source
SHA-256 checksum
How to use checksums
66533f2ac8b4b7c6140d19545410badd8dbae80fa5745722ab9edf286e7933a4
BLAKE2b-256 checksum
How to use checksums
d3c5d5e3b68a3596166cc0a73ebf091989cc26fb426bcdf4a2509136897be026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.13 Darwin/23.4.0

Release files / nonebot_plugin_bard-0.5.1-py3-none-any.whl

Download URL nonebot_plugin_bard-0.5.1-py3-none-any.whl
Size 438.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b74e37874ddb62e8c7615f19aefd313f79dea1f718b4bd6418c944c76cb870fb
BLAKE2b-256 checksum
How to use checksums
a28c7a6b4f1c5c3fdff81b1d62832820ef7824f077444f8c038611f274f73870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.13 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.0

2 release files

0.2.0

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