Skip to main content

A nonebot plugin for Bard

Project description

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搜视频插件

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_bard-0.5.0.tar.gz (430.0 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_bard-0.5.0-py3-none-any.whl (428.9 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_bard-0.5.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_bard-0.5.0.tar.gz
  • Upload date:
  • Size: 430.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.13 Darwin/23.4.0

File hashes

Hashes for nonebot_plugin_bard-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a85cb27722b7f4218e52c7982016f04618e74c9e68ee82ba02a7e34b1ec5d9b2
MD5 d72e66921049164acc04f0c49c1fc95e
BLAKE2b-256 aa5a4dc12e4af362daec874a99e7b1c28c2b402c384b0f5202f6faeb90ba0a80

See more details on using hashes here.

File details

Details for the file nonebot_plugin_bard-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_bard-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a3e57deef8600ea14e5824bd024ec2b14f411f1bd969712b38c31fc4a2b26ce
MD5 0def54d72e25c7700b11e890c6ecda1f
BLAKE2b-256 b3b7fa0a153440780d9058da3742b162996b2b22d37fa48e7d55c4ea2d436061

See more details on using hashes here.

Supported by

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