A nonebot plugin for Bard
Project description
nonebot-plugin-bard
介绍
- 本插件是适配Google Gemini网页版的聊天机器人插件,借助Gemini Pro的联网能力和多模态识别能力实现更准确地回复和图片识别回复等功能。
- 核心代码源于Gemini-API,本插件修改了其中部分内容以兼容其他插件的依赖版本。
- 由于历史原因,本插件的名称为nonebot-plugin-bard。
安装
-
手动安装
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获取方法
- 确保您已经拥有bard的访问权限
- 访问 https://gemini.google.com/
- 按 F12 打开控制台,进入应用程序(Application) → Cookies → 复制相应cookies的值
- cookies过一段时间可能会失效,如有报错更新即可
可选内容:
bard_enable_private_chat = True # 私聊开关,默认开启,改为False关闭
bard_proxy = "127.0.0.1:8001" # 配置代理访问Bard
使用方法
- Gemini 文字/图片 发起无记忆对话
- 连续对话 文字/图片 发起有记忆对话
- 结束连续对话 结束有记忆对话
- 清除记忆 管理员命令,删除所有连续对话的记忆
Gemini插件使用
在文字中添加@插件名(如@Youtube)可以调用Gemini网页版支持的插件
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.4.0.tar.gz
(430.2 kB
view details)
Built Distribution
File details
Details for the file nonebot_plugin_bard-0.4.0.tar.gz
.
File metadata
- Download URL: nonebot_plugin_bard-0.4.0.tar.gz
- Upload date:
- Size: 430.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.13 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef782233fb927436ae1eea4686be5c4e51d09d0018047c2794581365b5d4023a |
|
MD5 | 5191cce437494f32646d54b4ffd52271 |
|
BLAKE2b-256 | 241ad631f196f1309070a977f659e36a84bb875ffba367a2d0cf9800a65a4d48 |
File details
Details for the file nonebot_plugin_bard-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: nonebot_plugin_bard-0.4.0-py3-none-any.whl
- Upload date:
- Size: 429.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.13 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44bc7143445cf3656047542975488f5fd230ce9f3a79f6831aa94f517f2d47c2 |
|
MD5 | 2e395abc21b7c6184f4eacbe585f733c |
|
BLAKE2b-256 | cafc12e036f726c98b1fa0a0dfcfffb6ca0920d685e4e811362cc908a31a61d2 |