Chatbot plugin for Nonebot2
Top 86.5% on sourcepulse
This plugin integrates ChatGPT conversational AI into the Nonebot2 chatbot framework, enabling intelligent chat interactions for bot users. It allows for flexible configuration of triggers, conversation scope, and session management, enhancing the bot's utility as a conversational agent.
How It Works
The plugin leverages the official ChatGPT web interface by utilizing a session_token
for authentication, prioritizing this method over direct account credentials. It supports configurable proxy settings, automatic session token refresh, and message throttling via a cooldown timer. Conversations can be managed with features like history rollback, import/export, and saving/switching sessions, offering a robust stateful interaction model.
Quick Start & Requirements
nb plugin install nonebot-plugin-chatgpt
or package managers (pip
, pdm
, poetry
, conda
).nonebot.load_plugin('nonebot_plugin_chatgpt')
to bot.py
.CHATGPT_SESSION_TOKEN
(obtained from browser developer tools) or CHATGPT_ACCOUNT
/CHATGPT_PASSWORD
in .env
.FASTAPI_RELOAD=false
in .env.dev
.Highlighted Details
CHATGPT_COMMAND
) and context awareness (CHATGPT_TO_ME
).Maintenance & Community
The project acknowledges contributions from various developers. Further community engagement details are not explicitly provided in the README.
Licensing & Compatibility
The README does not specify a license. Compatibility for commercial use or closed-source linking is not detailed.
Limitations & Caveats
The plugin relies on the ChatGPT web interface, which may be subject to changes by OpenAI that could break functionality. Obtaining and managing the session_token
requires manual steps. The README notes potential issues on ARM platforms and specific configurations for Windows.
2 years ago
1 day