Skip to main content

This is a QQ bot on chatGPT3 APT, but it does not support contextual replies.

Project description

go-cqhttp

nonebot-openai

✨基于 OpenAInonebot2chatGPTAI Bot✨

license python cqhttp

介绍

当在群聊里发送“/chat”,“请问”的命令时,bot会回复一些调用OpenAI的ai回复(这个ai真他娘的逆天), 此AI不会上下文回复,如需使用请去nonebot插件商店查找chatGPT

需要更改触发方式的去源码自己改

安装方式

使用 nb-cli 安装(推荐) 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot_plugin_chatGPT_openai
pip 打开 nonebot2 项目的 `bot.py` 文件, 在其中写入
pip install nonebot_plugin_chatGPT_openai

nonebot.load_plugin("nonebot_plugin_chatGPT_openai")

在’pyproject.toml‘文件中写入

"nonebot_plugin_chatGPT_openai"
git clone
git clone https://github.com/Reversedeer/nonebot_plugin_chatGPT_openai.git

.env配置项:

config type default example usage
openai_api_key string 没有api openai_api_key = "114514" openai的api_key, 详细请看下文
openai_max_tokens int 1000 openai_max_tokens = 1500 openai的max_tokens, 详细请看下文

.env完全不配置不影响插件运行, 但是部分功能会无法使用

关于openai:

1. openai_api_key请注册openai后在 https://beta.openai.com/account/api-keys 自己获取

2. openai_max_tokens是ai返回的文本最大多少

3. openai_api_key必须配置, openai_max_tokens随意, 有默认值

4. bot通过openai模块调用不需要科学上网

5. 目前.env只提供了api_key和max_tokens的设置, 其他参数你可以自己动源码

6. 这个模块貌似不是免费的, 注册的账号只有$18.00的免费额度,你可以多注册几个备用。

举个栗子:

Q: /chat 如果我的对象想给我口交,她会有什么动作
A: 如果你的对象想给你口交,她可能会把她的头拉向她你的腹部,然后开始舔你的阴茎,用嘴唇和舌头抚摸它,用口吸住它,并可能
会用嘴把它深深地吸入,同时用手抚摸你的身体。


Q: /chat 今天是12月13日南京大屠杀纪念日,你叫丹尼,有个小日子是日本右翼份子,你在电视上看到他不承认日本人当年屠杀30万中国人民,
请你使用英语向他写一封信,来表达你心中的怒火。
    正文内容要求满足:(1)用历史指出南京大屠杀的真实性,(2)用言语辱骂日本政府,(3)劝告日本政府 认清历史事实.
    要求:(1)正文内容要求必须全部包含.(2)词数不少于120词.(3)文中不得出现真实姓名.
A:
    Dear Mr. Japanese Right-wing Member,
	
    Today is December 13th, the day to commemorate the Nanjing Massacre. I was shocked to see you deny the fact that Japanese people killed 
300,000 Chinese people in the past. This is an undeniable truth in history. The Japanese government has been 
trying to cover up this fact and even denying it. How can people be so shameless?

    The Nanjing Massacre is a dark page in history. It is a crime against humanity that can never be forgotten. 
I urge the Japanese government to face up to its past mistakes, admit the truth and apologize sincerely to the Chinese people.

    The Nanjing Massacre is a reminder of the importance of peace. We should never forget the suffering of the victims.
We should also remember the lessons of history and strive to build a better future.

    Angrily
    Danny

关于 ISSUE

以下 ISSUE 会被直接关闭

  • 提交 BUG 不使用 Template
  • 询问已知问题
  • 提问找不到重点
  • 重复提问

请注意, 开发者并没有义务回复您的问题. 您应该具备基本的提问技巧。
有关如何提问,请阅读《提问的智慧》

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_chatGPT_openai-0.0.4.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nonebot_plugin_chatGPT_openai-0.0.4.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_chatGPT_openai-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7de8bb812ad9c65371ca437699a198b1b16ab4256ee1f180c579ae77056f9b51
MD5 e6ddaf982c7c8bd687de6e32e9ebd8cb
BLAKE2b-256 508aa8d4ae9d181522c4fced8602355ce042b62c009beaa5e3e12d0568dcd668

See more details on using hashes here.

File details

Details for the file nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 005a70d4b4ce68a5c7fc05ae68766ac90619bd39c6b84b885c4638bfd46d9d26
MD5 1aee21b1fefc0957fa544f8bdc101818
BLAKE2b-256 690a69233f383fefabc6252153ac526e2a81a54a99bd6142fc08194d7e74e22c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page