✨ Gemini AI 对话 NoneBot 插件 ✨
Project description
Nonebot Plugin Gemini
Google Gemini AI 对话插件
功能
命令 | 用途 | 示例 |
---|---|---|
gemini <文本/图像> | 单次调用 Gemini 并获取回复 | gemini 编写一个NoneBot2的echo插件 |
geminichat [可选]<文本> | 开启一轮与 Gemini 的对话 | geminichat |
结束对话 | 结束本轮对话 | 结束对话 |
如果你配置了命令头,请在使用命令时将命令头加上
安装方法
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-gemini
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-gemini
pdm
pdm add nonebot-plugin-gemini
poetry
poetry add nonebot-plugin-gemini
conda
conda install nonebot-plugin-gemini
打开 nonebot2 项目根目录下的 pyproject.toml
文件, 在 [tool.nonebot]
部分追加写入
plugins = ["nonebot_plugin_gemini"]
配置
在 Google AI Studio 获取 GOOGLE_API_KEY
后,在 .env 文件 或 环境变量 中添加 GOOGLE_API_KEY
配置项 | 默认值 | 说明 |
---|---|---|
GOOGLE_API_KEY | 无 | Google AI Studio 的 API Key |
PROXY | 无 | 可选。代理地址,格式为 http://ip:port 或 socks5://ip:port |
IMAGE_RENDER_LENGTH | 500 | 可选。超过这个数值的回复将会以 Markdown 渲染为图片 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot_plugin_gemini-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 439f7ff37e85b9721136ccc4357cfdaf34138b332eed48271f27231d7092f5d1 |
|
MD5 | e2a6dcfbe0e5aee948a1f218e7f22efd |
|
BLAKE2b-256 | abf8ff7e220edad36d46decba10ca3796a78de36c0774b87509a1dd2c75e4f4f |
Close
Hashes for nonebot_plugin_gemini-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616135e8b5aea52a105063821e248f28639e27bf1c2c38cd1188843ba01d9aa9 |
|
MD5 | 88a75c1ae4c58adda0d390b9e2ff2b8d |
|
BLAKE2b-256 | feddd9aaf2d4bb737ac6c0e8e894b12f9ff8905c78ee868c88866f524ee16d29 |