All of these functions were not working since it needs a special trick
to call javscript async function within lua:
https://github.com/ceifa/wasmoon/issues/22
The proper trick for allowing async function was added.
Also added missing awaits for similarity search.
You can use following lua trigger to test out the behaviour:
```lua
listenEdit("editOutput", function(triggerId, data)
local res = similarity(triggerId, data, {"happy", "angry", "sad"}):await()
return res[1]
end)
```
Note you need https://github.com/kwaroran/RisuAI/pull/572 to test this
out since low level access is disabled for lua right now.
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?
# Description
Currently, some of the operators in the trigger block seem to be working
in reverse.
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?
# Description
aws += sonnet-3-5
custom += sonnet-3-5, gpt-4-turbo
Everything works as intended.
when the first chat limit is reached, it succesfully summarize the previous chats according to the chunk size, and then returns the chat with summarized text as a system prompt, with other chats after that summarized point correctly appended.
Automatic sub-chunking also works perfectly.
Tested with sub-model.
back to original logic, only model selection is implemented.
Previous issue: the mainChunks object holds list of summarized texts, but for somewhat reason they are deleted after usage, and then re-added again, summarizing same chats.