diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-10-28 22:28:16 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-10-28 22:28:16 +0000 |
commit | e22d58cee6d9bb963f879fde8890e7743269afb3 (patch) | |
tree | 7521268ce29b4fca3b97bfe7451a828b7b880ca5 /plugins.go | |
parent | added a new option, context. fixed a bug with the custom commands where the c... (diff) | |
download | milla-e22d58cee6d9bb963f879fde8890e7743269afb3.tar.gz milla-e22d58cee6d9bb963f879fde8890e7743269afb3.zip |
added openrouter as a provider
Diffstat (limited to 'plugins.go')
-rw-r--r-- | plugins.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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)), |