Based on Nonebot & GO-CQHTTP
Codybot2 View Robot
This is a private project, but the contents are welcome to refer to and transplant.
The robot's dialogue mechanism defaults to continuous dialogue, with a certain degree of conversation memory ability, and has different response adaptations to private chats and group chats, which can handle the logic, name, etc. of multi-person conversations well.
Cody is a cute pony.
Configuration method: Just add the following configuration items to the NoneBot global configuration file.
ENVIRONMENT=dev
HOST=127.0.0.1 # Onebot Listen
PORT=8089 # 监听端口
SUPERUSER=["1234567890"] # nonebot2 的超管(也可理解为bot的主人什么的)
cody_session_cache_dir = "memory/" # 缓存路径
cody_gpt3_apikey_path = "configs/gpt3_api.yml" # api文件的路径
cody_gpt3_max_tokens = 500 # 最大返回值长度
cody_max_session_tokens = 2000 # 最大连续对话长度
cody_session_forget_timeout = 43200 # 会话从多少秒后开始忘记
cody_api_proxy = "127.0.0.1:1080" # 设置代理
This project can be extracted from a separate module, but the Nonebot adaptor is nonebot-adaptor-cqhttp. If the bot that is not this adaptor is directly ported, compatibility problems may occur.
Added support for proxy, allowing this service to be used in areas where openai's API interface is not accessible due to geographic factors.