semvec/pypi-packages huggingface dataset:
nonebot-plugin-bard 0.5.1
A nonebot plugin for Bard
License: MIT
Requires Python: <4.0,>=3.10

<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)
djau-gsuite-email 0.1.6
Send emails via a GSuite Service-account.
License: MIT
Requires Python: >=3.0.0


# GSuite Email Backend

[![Downloads](https://static.pepy.tech/personalized-badge/django-gsuite-email?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/django-gsuite-email)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/slicefox/django-gsuite-email?color=brightgreen)
![GitHub issues](https://img.shields.io/github/issues/slicefox/django-gsuite-email)
[![Documentation Status](https://readthedocs.org/projects/django-gsuite-email/badge/?version=latest)](https://django-gsuite-email.readthedocs.io/en/latest/?badge=latest)

This package allows to use Django's `send_mail` command to send emails through GSuite account.

It requires a serviceaccount credential created in Google coud console,
The crendential file need to have `https://www.googleapis.com/auth/gmail.send` scope.

Follow [this tutorial](https://developers.google.com/identity/protocols/oauth2/service-account#python) to create the credentials file, make sure to add `https://www.googleapis.com/auth/gmail.send` scope.


## Installation
```sh
pip install django-gsuite-email
```

# Quick start

#### 1. Add it to installed apps in `setings.py`
```python
INSTALLED_APPS = [
    ...
    'django_gsuite_email',
    ...
]
```
#### 2. Set the Email EMAIL_BACKEND setting
```python
EMAIL_BACKEND = 'django_gsuite_email.GSuiteEmailBackend'
```

#### 3. Set location of credentials file.
To do this, either set `GSUITE_CREDENTIALS_FILE` environment variable.\
OR \
set `GSUITE_CREDENTIALS_FILE` in `settings.py`

```python
GSUITE_CREDENTIALS_FILE="/path/to/credentials/file.json"
GSUITE_USER_FROM_EMAIL = False  # use the user of from_email if True. Default value False.
GMAIL_USER = 'user@domain'      # default user if GSUITE_USER_FROM_EMAIL is not True. Default value None.
GMAIL_SCOPES = ['https://www.googleapis.com/auth/gmail.send', ... ] # Default value ['https://www.googleapis.com/auth/gmail.send', ]
```

> #### Note: `GSUITE_CREDENTIALS_FILE` in `settings.py` will take precedence over environment variable.

#### 4. Send emails
```python
from django.core.mail import send_mail

send_mail(
    'Subject here',
    'Here is the message.',
    'from@example.com',
    ['to@example.com'],
    fail_silently=False,
)
```