aboutsummaryrefslogtreecommitdiffstats
path: root/plugins.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins.go')
-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)),