add llms and make it easier to add new ones i think #1
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: flashii/komeiji-senses#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Neeko/komeiji-senses:llmupdate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
hopefully this isn't totally dogass have fun!!
using the review feature for the first time ever whoa hope i did alright
i'll definitely follow up on your complaint about lacking functionality in Lua in chat last night by providing a library that contains a bunch of array macros and whatnot
@ -123,2 +137,4 @@
local matchAt = msg.textClean:sub(2, spacePos - 1):lower()
local eightBall
local englishNames = { -- new LLMs are added every week, making this into a list allows you to add new ones easier, i think.
"grok", "chatgpt", "askperplexity", "gemini", "bard", "copilot", "deepseek", "supergrok", "gork", "siri"
maybe it'd be nicer to have this be a dictionary that contains = so like
which would also leave the ability to specify per-phrase distances :D
you can still just use like length / 2 as the initial values for the ones that weren't there yet, rounded up or down whichever you feel like
this is smarter than the original way i was thinking of adding arbitrary distances, would have to figure out how to actually access the keys in the value pair, im sure it's easy enough, though.
i think you'd have to use the ipairs iterator for that
for k,v in ipairs(englishNames) do
, i'm not sure if that is the exact syntax though@ -125,2 +142,3 @@
local frenchNames = {"gorque"} -- i don't speak french but i figure i should do this to both.
if matchAt == "gorque" then
if superLesbian(frenchNames, matchAt, false) then
its fine to just leave this as an exact match since its a one off gag and not have to bother with the if statement in the array lookup function
i can do that easy, i thought it might be fun to add chatte gpt amongst other things - but if we only want groque to hit french 8ball that's fair.
@ -127,2 +144,3 @@
if superLesbian(frenchNames, matchAt, false) then
eightBall = bouleMagiqueNumeroHuit
elseif lesbian("grok", matchAt) < 4 or lesbian("askperplexity", matchAt) < 8 then
elseif superLesbian(englishNames, matchAt, true) then
following the comment on englishNames you could replace the
superLesbian
func entirely with a hashmap lookup, just something likesomewhat unfortunate bc it was a great name 😭
wouldn't a hashmap lookup require being exact - failing if message is grko instead of grok?
it would save a few (a lot) of cycles if the message was exact but otherwise wouldn't it still need the superLesbian func anyway to go through the list?
wait no yeah you're absolutely right sorry i'm not sure what i was thinking, however you could still use the hashmap to keep the different specific distance values
@ -58,1 +58,4 @@
local function superLesbian(stringTable, str1, leven)
for key, dist in stringTable do
if leven
Could you also remove this if and associated parameter? since its no longer being used without it
also bump the version in sense.toml to 1.1.0 if you wana, since added functionality
other than these last few nitpicks this looks good to me, i'll test it in a bit!
@ -59,0 +60,4 @@
for key, dist in stringTable do -- lame string chceker thing
if lesbian(key, str1) < dist then
return true
end
this feels extremely nitpicky on my part but this should have one less indent
its not indentation is important
@ -127,2 +138,3 @@
eightBall = bouleMagiqueNumeroHuit
elseif lesbian("grok", matchAt) < 4 or lesbian("askperplexity", matchAt) < 8 then
elseif superLesbian(englishNames, matchAt) then
--elseif lesbian("grok", matchAt) < 4 or lesbian("askperplexity", matchAt) < 8 then
you may remove this comment
the past removed for the future.
@ -59,0 +61,4 @@
if lesbian(key, str1) < dist then
return true
end
return false
Just noticed an oversight here, probably happened when reducing it from its previous implementation, the
return false
is within the for loop and the function itself doesn't have an endwhooops
Final set of requests before we should be good! Mostly Lua specific moments and one more style thingy.
@ -56,6 +56,15 @@ local bouleMagiqueNumeroHuit = {
"Vous avez atteint notre limite de messages par 1 minute. Veuillez réessayer plus tard.",
}
local function superLesbian(stringTable, str1)
Can you move this function below lesbian? Apparently declaration order matters for local functions, I wasn't aware of this either 😎
Whoops pt2
@ -57,2 +57,4 @@
}
local function superLesbian(stringTable, str1)
for key, dist in stringTable do -- lame string chceker thing
in stringTable do
should bein pairs(stringTable) do
oh interesting, my apologies. my epic and awesome lua lsp server didn't catch or warn me about that.
@ -122,10 +131,13 @@ kmj.satori.addMessageHandler(function(msg, isSelf)
local matchAt = msg.textClean:sub(2, spacePos - 1):lower()
local eightBall
local englishNames = { -- new LLMs are added every week, making this into a list allows you to add new ones easier, i think.
Can you move this above lesbian (so basically where superLesbian is currently)? I want to keep config type thingies at the top, somehow didn't realise it wasn't there until at the top already until now.
makes sense to me, will do
LGTM as they say