summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-12-03 13:29:57 +0300
committerGrail Finder <wohilas@gmail.com>2025-12-03 13:29:57 +0300
commitcec10210c284a17cd341b48ee205bcfd278205bd (patch)
tree2976a543026c4ee79ad68bef5d970e104f684c4e /bot.go
parente5eaba1d5a6c07b3a02d38dcc81dbac49bffcc38 (diff)
Feat: props table instead of form
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/bot.go b/bot.go
index 66786ca..bd1ce3f 100644
--- a/bot.go
+++ b/bot.go
@@ -32,6 +32,8 @@ var (
cfg *config.Config
logger *slog.Logger
logLevel = new(slog.LevelVar)
+)
+var (
activeChatName string
chunkChan = make(chan string, 10)
openAIToolChan = make(chan string, 10)
@@ -65,6 +67,22 @@ var (
}
)
+// GetLogLevel returns the current log level as a string
+func GetLogLevel() string {
+ level := logLevel.Level()
+ switch level {
+ case slog.LevelDebug:
+ return "Debug"
+ case slog.LevelInfo:
+ return "Info"
+ case slog.LevelWarn:
+ return "Warn"
+ default:
+ // For any other values, return "Info" as default
+ return "Info"
+ }
+}
+
func createClient(connectTimeout time.Duration) *http.Client {
// Custom transport with connection timeout
transport := &http.Transport{