ChatGPT: add some spammy junk options...

This commit is contained in:
Gordon Shumway 2023-04-07 01:25:27 -04:00 committed by GitHub
parent dfac3d2772
commit 585ef8f2de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

View File

@ -77,6 +77,32 @@ conf.registerChannelValue(
),
)
conf.registerChannelValue(
ChatGPT,
"reply_intact",
registry.Boolean(
False,
_(
"""
Get spammy and enable line per line reply...
"""
),
),
)
conf.registerChannelValue(
ChatGPT,
"nick_prefix",
registry.Boolean(
True,
_(
"""
Prefix nick on replies true/false...
"""
),
),
)
conf.registerChannelValue(
ChatGPT,
"temperature",

View File

@ -59,8 +59,14 @@ class ChatGPT(callbacks.Plugin):
frequency_penalty=self.registryValue("frequency_penalty", msg.channel),
user=msg.nick,
)
response = " ".join(completion.choices[0].message.content.splitlines())
irc.reply(response)
prefix = self.registryValue("nick_prefix", msg.channel)
if self.registryValue("reply_intact", msg.channel):
for line in completion.choices[0].message.content.splitlines():
if line:
irc.reply(line, prefixNick=prefix)
else:
response = " ".join(completion.choices[0].message.content.splitlines())
irc.reply(response, prefixNick=prefix)
chat = wrap(chat, ["text"])