aboutsummaryrefslogtreecommitdiffstats
path: root/plugins.go
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-09-01 16:21:36 +0000
committerterminaldweller <devi@terminaldweller.com>2024-09-01 16:21:36 +0000
commitbcbbf64fb78f3c7248987968cccc4c97a4c5e3a2 (patch)
tree82fe5fd8fb73ea9e1f90c67593faf683cad3a680 /plugins.go
parentadded the url to the rss output. fixed a bug with the rss feeds where differe... (diff)
downloadmilla-bcbbf64fb78f3c7248987968cccc4c97a4c5e3a2.tar.gz
milla-bcbbf64fb78f3c7248987968cccc4c97a4c5e3a2.zip
fixes 8
Diffstat (limited to '')
-rw-r--r--plugins.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins.go b/plugins.go
index 2503e3d..3e29570 100644
--- a/plugins.go
+++ b/plugins.go
@@ -244,7 +244,7 @@ func ollamaRequestClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lua
result, err := DoOllamaRequest(appConfig, &[]MemoryElement{}, prompt)
if err != nil {
- log.Print(err)
+ LogError(err)
}
luaState.Push(lua.LString(result))
@@ -259,7 +259,7 @@ func geminiRequestClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lua
result, err := DoGeminiRequest(appConfig, &[]*genai.Content{}, prompt)
if err != nil {
- log.Print(err)
+ LogError(err)
}
luaState.Push(lua.LString(result))
@@ -274,7 +274,7 @@ func chatGPTRequestClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lu
result, err := DoChatGPTRequest(appConfig, &[]openai.ChatCompletionMessage{}, prompt)
if err != nil {
- log.Print(err)
+ LogError(err)
}
luaState.Push(lua.LString(result))
@@ -295,13 +295,13 @@ func dbQueryClosure(luaState *lua.LState, appConfig *TomlConfig) func(*lua.LStat
rows, err := appConfig.pool.Query(context.Background(), query)
if err != nil {
- log.Println(err.Error())
+ LogError(err)
}
defer rows.Close()
logs, err := pgx.CollectRows(rows, pgx.RowToStructByName[LogModel])
if err != nil {
- log.Println(err.Error())
+ LogError(err)
}
table := luaState.CreateTable(0, len(logs))
@@ -388,7 +388,7 @@ func RunScript(scriptPath string, client *girc.Client, appConfig *TomlConfig) {
if proxyString != "" {
proxyURL, err := url.Parse(proxyString)
if err != nil {
- log.Print(err)
+ LogError(err)
}
proxyTransport.Proxy = http.ProxyURL(proxyURL)
}
@@ -399,7 +399,7 @@ func RunScript(scriptPath string, client *girc.Client, appConfig *TomlConfig) {
err := luaState.DoFile(scriptPath)
if err != nil {
- log.Print(err)
+ LogError(err)
}
}
@@ -454,7 +454,7 @@ func RunLuaFunc(
if proxyString != "" {
proxyURL, err := url.Parse(proxyString)
if err != nil {
- log.Print(err)
+ LogError(err)
}
proxyTransport.Proxy = http.ProxyURL(proxyURL)
}
@@ -464,7 +464,7 @@ func RunLuaFunc(
log.Print("Running lua command script: ", scriptPath)
if err := luaState.DoFile(scriptPath); err != nil {
- log.Print(err)
+ LogError(err)
return ""
}
@@ -479,7 +479,7 @@ func RunLuaFunc(
log.Print(args)
if err := luaState.CallByParam(funcLValue, lua.LString(args)); err != nil {
log.Print("failed running lua command ...")
- log.Print(err)
+ LogError(err)
return ""
}