Merge branch 'oddluck:master' into master

This commit is contained in:
klapvogn 2024-10-12 14:44:49 +02:00 committed by GitHub
commit af11a35d0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 2 deletions

View File

@ -11,7 +11,7 @@ Model:
```
@config plugins.chatgpt.model gpt-4o-mini
```
^^ Use this config to set the language model. Current recommendation: gpt-40-mini
^^ Use this config to set the language model. Current recommendation: gpt-4o-mini
History:
```

View File

@ -54,6 +54,16 @@ ChatGPT = conf.registerPlugin("ChatGPT")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(ChatGPT, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
ChatGPT,
"enabled",
registry.Boolean(
True,
_("""Set False to disable the plugin, True to enable."""),
),
)
conf.registerGlobalValue(
ChatGPT,
"api_key",

View File

@ -53,6 +53,8 @@ class ChatGPT(callbacks.Plugin):
channel = msg.channel
if not irc.isChannel(channel):
channel = msg.nick
if not self.registryValue("enabled", msg.channel):
return
if self.registryValue("nick_include", msg.channel):
text = "%s: %s" % (msg.nick, text)
self.history.setdefault(channel, None)

View File

@ -21,7 +21,7 @@ system prompt:
```
@chat <text>
```
^^ Command to send text to the chatgpt API
^^ Command to send text to the Gemini API
```
@messageparser add "(?i)(.*BOT_NICK_HERE.*)" "chat $1"

View File

@ -55,6 +55,15 @@ Gemini = conf.registerPlugin("Gemini")
# conf.registerGlobalValue(Gemini, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
Gemini,
"enabled",
registry.Boolean(
True,
_("""Set False to disable the plugin, True to enable."""),
),
)
conf.registerChannelValue(
Gemini,
"api_key",

View File

@ -53,6 +53,8 @@ class Gemini(callbacks.Plugin):
channel = msg.channel
if not irc.isChannel(channel):
channel = msg.nick
if not self.registryValue("enabled", msg.channel):
return
genai.configure(api_key=self.registryValue("api_key", msg.channel))
prompt = self.registryValue("prompt", msg.channel).replace("$botnick", irc.nick)
max_tokens = self.registryValue("max_tokens", msg.channel)

View File

@ -1,3 +1,5 @@
Spiffytitles is no longer supported... By me... Please feel free to fork!
Highly customizable and fully-featured link title snarfer with many URL handlers.
Forked from https://github.com/butterscotchstallion/limnoria-plugins/tree/master/SpiffyTitles