Skip to main content

go-cqhttp

nonebot-openai

✨基于 OpenAI和nonebot2的chatGPTAI 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
  • 询问已知问题
  • 提问找不到重点
  • 重复提问

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

Metadata

Release files for nonebot-plugin-chatGPT-openai 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-chatGPT-openai 0.0.4
File Size Uploaded Provenance Actions
nonebot_plugin_chatGPT_openai-0.0.4.tar.gz 18.2 kB Without provenance Details for nonebot_plugin_chatGPT_openai-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-chatGPT-openai 0.0.4
File Interpreter ABI Platform Actions
nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl Python 3 none any Details for nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl

Total release size: 36.6 kB

Release files / nonebot_plugin_chatGPT_openai-0.0.4.tar.gz

Download URL nonebot_plugin_chatGPT_openai-0.0.4.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7de8bb812ad9c65371ca437699a198b1b16ab4256ee1f180c579ae77056f9b51
BLAKE2b-256 checksum
How to use checksums
508aa8d4ae9d181522c4fced8602355ce042b62c009beaa5e3e12d0568dcd668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl

Download URL nonebot_plugin_chatGPT_openai-0.0.4-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
005a70d4b4ce68a5c7fc05ae68766ac90619bd39c6b84b885c4638bfd46d9d26
BLAKE2b-256 checksum
How to use checksums
690a69233f383fefabc6252153ac526e2a81a54a99bd6142fc08194d7e74e22c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for nonebot-plugin-chatGPT-openai 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page