From e22d58cee6d9bb963f879fde8890e7743269afb3 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Mon, 28 Oct 2024 18:28:16 -0400 Subject: added openrouter as a provider --- plugins.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'plugins.go') 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)), -- cgit v1.2.3