nonebot-plugin-bard


Namenonebot-plugin-bard JSON
Version 0.5.1 PyPI version JSON
download
home_pageNone
SummaryA nonebot plugin for Bard
upload_time2024-04-24 11:13:20
maintainerNone
docs_urlNone
authorAlpaca
requires_python<4.0,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot-plugin-bard
</div>

# 介绍
- 本插件是适配Google Gemini网页版的聊天机器人插件,借助Gemini Pro的联网能力和多模态识别能力实现更准确地回复和图片识别回复等功能。
- 核心代码源于[Gemini-API](https://github.com/HanaokaYuzu/Gemini-API),本插件修改了其中部分内容以兼容其他插件的依赖版本。
- 由于历史原因,本插件的名称为nonebot-plugin-bard。
- ![Gemini Pro的联网能力](nonebot_plugin_bard/images/demo2.jpg)
- ![Gemini Pro的多模态识别能力](nonebot_plugin_bard/images/demo1.jpg)
# 安装

* 手动安装
  ```
  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的值
```
<a id='cookies'></a>
### cookies获取方法
0. 确保您已经拥有bard的访问权限
1. 访问 https://gemini.google.com/
2. 按 F12 打开控制台,进入应用程序(Application) → Cookies → 复制相应cookies的值
3. cookies过一段时间可能会失效,如有报错更新即可

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

# 使用方法
- Gemini 文字/图片  发起无记忆对话
- 连续对话 文字/图片  发起有记忆对话
- 结束连续对话   结束有记忆对话
- 清除记忆 管理员命令,删除所有连续对话的记忆
  
# Gemini插件使用
在文字中添加@插件名(如@Youtube)可以调用Gemini网页版支持的插件
![Gemini Pro的youtube搜视频插件](nonebot_plugin_bard/images/demo3.jpg)
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nonebot-plugin-bard",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Alpaca",
    "author_email": "alpaca@bupt.edu.cn",
    "download_url": "https://files.pythonhosted.org/packages/d3/c5/d5e3b68a3596166cc0a73ebf091989cc26fb426bcdf4a2509136897be026/nonebot_plugin_bard-0.5.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot-plugin-bard\n</div>\n\n# \u4ecb\u7ecd\n- \u672c\u63d2\u4ef6\u662f\u9002\u914dGoogle Gemini\u7f51\u9875\u7248\u7684\u804a\u5929\u673a\u5668\u4eba\u63d2\u4ef6\uff0c\u501f\u52a9Gemini Pro\u7684\u8054\u7f51\u80fd\u529b\u548c\u591a\u6a21\u6001\u8bc6\u522b\u80fd\u529b\u5b9e\u73b0\u66f4\u51c6\u786e\u5730\u56de\u590d\u548c\u56fe\u7247\u8bc6\u522b\u56de\u590d\u7b49\u529f\u80fd\u3002\n- \u6838\u5fc3\u4ee3\u7801\u6e90\u4e8e[Gemini-API](https://github.com/HanaokaYuzu/Gemini-API)\uff0c\u672c\u63d2\u4ef6\u4fee\u6539\u4e86\u5176\u4e2d\u90e8\u5206\u5185\u5bb9\u4ee5\u517c\u5bb9\u5176\u4ed6\u63d2\u4ef6\u7684\u4f9d\u8d56\u7248\u672c\u3002\n- \u7531\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u672c\u63d2\u4ef6\u7684\u540d\u79f0\u4e3anonebot-plugin-bard\u3002\n- ![Gemini Pro\u7684\u8054\u7f51\u80fd\u529b](nonebot_plugin_bard/images/demo2.jpg)\n- ![Gemini Pro\u7684\u591a\u6a21\u6001\u8bc6\u522b\u80fd\u529b](nonebot_plugin_bard/images/demo1.jpg)\n# \u5b89\u88c5\n\n* \u624b\u52a8\u5b89\u88c5\n  ```\n  git clone https://github.com/Alpaca4610/nonebot_plugin_bard.git\n  ```\n\n  \u4e0b\u8f7d\u5b8c\u6210\u540e\u5728bot\u9879\u76ee\u7684pyproject.toml\u6587\u4ef6\u624b\u52a8\u6dfb\u52a0\u63d2\u4ef6\uff1a\n\n  ```\n  plugin_dirs = [\"xxxxxx\",\"xxxxxx\",......,\"\u4e0b\u8f7d\u5b8c\u6210\u7684\u63d2\u4ef6\u8def\u5f84/nonebot_plugin_bard\"]\n  ```\n* \u4f7f\u7528 pip\n  ```\n  pip install nonebot-plugin-bard\n  ```\n\n# \u914d\u7f6e\u6587\u4ef6\n\n## \u5fc5\u9009\u5185\u5bb9\n\u5728Bot\u6839\u76ee\u5f55\u4e0b\u7684.env\u6587\u4ef6\u4e2d\u586b\u5165Bard\u7684cookies\u4fe1\u606f\uff1a\n```\ngemini_token1 = xxxxxxxx  # __Secure_1PSID\u7684\u503c\ngemini_token2 = xxxxxxxx  # __Secure_1PSIDTS\u7684\u503c\n```\n<a id='cookies'></a>\n### cookies\u83b7\u53d6\u65b9\u6cd5\n0. \u786e\u4fdd\u60a8\u5df2\u7ecf\u62e5\u6709bard\u7684\u8bbf\u95ee\u6743\u9650\n1. \u8bbf\u95ee https://gemini.google.com/\n2. \u6309 F12 \u6253\u5f00\u63a7\u5236\u53f0\uff0c\u8fdb\u5165\u5e94\u7528\u7a0b\u5e8f(Application) \u2192 Cookies \u2192 \u590d\u5236\u76f8\u5e94cookies\u7684\u503c\n3. cookies\u8fc7\u4e00\u6bb5\u65f6\u95f4\u53ef\u80fd\u4f1a\u5931\u6548\uff0c\u5982\u6709\u62a5\u9519\u66f4\u65b0\u5373\u53ef\n\n##  \u53ef\u9009\u5185\u5bb9\uff1a\n```\nbard_enable_private_chat = True   # \u79c1\u804a\u5f00\u5173\uff0c\u9ed8\u8ba4\u5f00\u542f\uff0c\u6539\u4e3aFalse\u5173\u95ed\nbard_proxy = \"127.0.0.1:8001\"    # \u914d\u7f6e\u4ee3\u7406\u8bbf\u95eeBard\n```\n\n# \u4f7f\u7528\u65b9\u6cd5\n- Gemini \u6587\u5b57/\u56fe\u7247  \u53d1\u8d77\u65e0\u8bb0\u5fc6\u5bf9\u8bdd\n- \u8fde\u7eed\u5bf9\u8bdd \u6587\u5b57/\u56fe\u7247  \u53d1\u8d77\u6709\u8bb0\u5fc6\u5bf9\u8bdd\n- \u7ed3\u675f\u8fde\u7eed\u5bf9\u8bdd   \u7ed3\u675f\u6709\u8bb0\u5fc6\u5bf9\u8bdd\n- \u6e05\u9664\u8bb0\u5fc6 \u7ba1\u7406\u5458\u547d\u4ee4\uff0c\u5220\u9664\u6240\u6709\u8fde\u7eed\u5bf9\u8bdd\u7684\u8bb0\u5fc6\n  \n# Gemini\u63d2\u4ef6\u4f7f\u7528\n\u5728\u6587\u5b57\u4e2d\u6dfb\u52a0@\u63d2\u4ef6\u540d\uff08\u5982@Youtube\uff09\u53ef\u4ee5\u8c03\u7528Gemini\u7f51\u9875\u7248\u652f\u6301\u7684\u63d2\u4ef6\n![Gemini Pro\u7684youtube\u641c\u89c6\u9891\u63d2\u4ef6](nonebot_plugin_bard/images/demo3.jpg)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A nonebot plugin for Bard",
    "version": "0.5.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a28c7a6b4f1c5c3fdff81b1d62832820ef7824f077444f8c038611f274f73870",
                "md5": "853016032e3d235d9b41315758dce2ed",
                "sha256": "b74e37874ddb62e8c7615f19aefd313f79dea1f718b4bd6418c944c76cb870fb"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_bard-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "853016032e3d235d9b41315758dce2ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 438615,
            "upload_time": "2024-04-24T11:13:18",
            "upload_time_iso_8601": "2024-04-24T11:13:18.732247Z",
            "url": "https://files.pythonhosted.org/packages/a2/8c/7a6b4f1c5c3fdff81b1d62832820ef7824f077444f8c038611f274f73870/nonebot_plugin_bard-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d3c5d5e3b68a3596166cc0a73ebf091989cc26fb426bcdf4a2509136897be026",
                "md5": "67df564b808b2c44fecb664b7f96a2cc",
                "sha256": "66533f2ac8b4b7c6140d19545410badd8dbae80fa5745722ab9edf286e7933a4"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_bard-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "67df564b808b2c44fecb664b7f96a2cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 437322,
            "upload_time": "2024-04-24T11:13:20",
            "upload_time_iso_8601": "2024-04-24T11:13:20.848770Z",
            "url": "https://files.pythonhosted.org/packages/d3/c5/d5e3b68a3596166cc0a73ebf091989cc26fb426bcdf4a2509136897be026/nonebot_plugin_bard-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 11:13:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nonebot-plugin-bard"
}
        
Elapsed time: 0.54734s