aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-10-28 22:28:16 +0000
committerterminaldweller <devi@terminaldweller.com>2024-10-28 22:28:16 +0000
commite22d58cee6d9bb963f879fde8890e7743269afb3 (patch)
tree7521268ce29b4fca3b97bfe7451a828b7b880ca5 /plugins
parentadded a new option, context. fixed a bug with the custom commands where the c... (diff)
downloadmilla-e22d58cee6d9bb963f879fde8890e7743269afb3.tar.gz
milla-e22d58cee6d9bb963f879fde8890e7743269afb3.zip
added openrouter as a provider
Diffstat (limited to '')
-rw-r--r--plugins.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins.go b/plugins.go
index 3e29570..0ffaba2 100644
--- a/plugins.go
+++ b/plugins.go
@@ -238,6 +238,21 @@ func ircPartChannelClosure(luaState *lua.LState, client *girc.Client) func(*lua.
}
}
+func orRequestClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lua.LState) int {
+ return func(luaState *lua.LState) int {
+ prompt := luaState.CheckString(1)
+
+ result, err := DoORRequest(appConfig, &[]MemoryElement{}, prompt)
+ if err != nil {
+ LogError(err)
+ }
+
+ luaState.Push(lua.LString(result))
+
+ return 1
+ }
+}
+
func ollamaRequestClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lua.LState) int {
return func(luaState *lua.LState) int {
prompt := luaState.CheckString(1)
@@ -334,6 +349,7 @@ func millaModuleLoaderClosure(luaState *lua.LState, client *girc.Client, appConf
"send_ollama_request": lua.LGFunction(ollamaRequestClosure(luaState, appConfig)),
"send_gemini_request": lua.LGFunction(geminiRequestClosure(luaState, appConfig)),
"send_chatgpt_request": lua.LGFunction(chatGPTRequestClosure(luaState, appConfig)),
+ "send_or_request": lua.LGFunction(orRequestClosure(luaState, appConfig)),
"query_db": lua.LGFunction(dbQueryClosure(luaState, appConfig)),
"register_cmd": lua.LGFunction(registerLuaCommand(luaState, appConfig)),
"url_encode": lua.LGFunction(urlEncode(luaState)),