Skip to main content

A nonebot plugin for Bard

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-bard

介绍

  • 本插件是适配Google Bard模型的聊天机器人插件,借助bard的联网能力和多模态识别能力实现更准确地回复和图片识别回复等功能。
  • 目前中文回答和英文回答使用的模型均为Gemini Pro
  • 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信息:

bard_token = xxxxxxxx

cookies获取方法

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

可选内容:

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

若配置了bard_token还无法访问bard,请额外增加两项cookies信息,bard_token也需要配置)

bard_token1 = "xxxxxxxx"  # "__Secure-1PSIDTS"的值
bard_token2 = "xxxxxxxx"  # "__Secure-1PSIDCC"的值

使用方法

  • bard+文字 发起无记忆对话
  • bard+图片 调用bard的多模态识别能力识图

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.2.0.tar.gz (361.9 kB view details)

Uploaded Source

Built Distribution

nonebot_plugin_bard-0.2.0-py3-none-any.whl (360.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_bard-0.2.0.tar.gz
  • Upload date:
  • Size: 361.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.6 Darwin/23.2.0

File hashes

Hashes for nonebot_plugin_bard-0.2.0.tar.gz
Algorithm Hash digest
SHA256 76ef43807aff6ba0c8cfe5b24c0d44910652c9776a92b48abd356804842fedd7
MD5 ba463aeb56b5d6e4bb9f0ff16039e6c0
BLAKE2b-256 93f46948c54c9de4862d1aa5ab7e3ccdb5b55bcc021a2ccf43f14caae060a04b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_bard-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c9ed781d5adee7b8abcdd0d6a06ee50b66353dd2b005877a4eb75384dfa4e7
MD5 f29fd83c6f269fd0fcc5ef7900363f24
BLAKE2b-256 7f3c4269c0f5917184bde792e3a489c5daa0772f4bb157a9323eee27fb2a4fb9

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