nonebot-plugin-chatgpt  by A-kirami

Chatbot plugin for Nonebot2

created 2 years ago
317 stars

Top 86.5% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install via nb plugin install nonebot-plugin-chatgpt or package managers (pip, pdm, poetry, conda).
  • Add nonebot.load_plugin('nonebot_plugin_chatgpt') to bot.py.
  • Configure CHATGPT_SESSION_TOKEN (obtained from browser developer tools) or CHATGPT_ACCOUNT/CHATGPT_PASSWORD in .env.
  • Windows users may need FASTAPI_RELOAD=false in .env.dev.
  • See official documentation for detailed setup and configuration.

Highlighted Details

  • Supports session token-based authentication for ChatGPT.
  • Offers conversation management: refresh, export, import, save, switch, and rollback.
  • Configurable triggers (CHATGPT_COMMAND) and context awareness (CHATGPT_TO_ME).
  • Option to send responses as images for better rendering.

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.

Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.