1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-08 17:06:42 +00:00

better search tools

This commit is contained in:
Laura
2025-08-14 17:08:45 +02:00
parent 5d44980510
commit 0b51ee9dad
17 changed files with 335 additions and 102 deletions

23
env.go
View File

@@ -10,16 +10,29 @@ import (
)
var (
Debug bool
MaxIterations int
Debug bool
CleanContent bool
MaxIterations int
OpenRouterToken string
ExaToken string
)
func init() {
log.MustPanic(godotenv.Load())
// enable debug logs & prints
Debug = os.Getenv("DEBUG") == "true"
if Debug {
log.Warning("Debug mode enabled")
}
// de-ai assistant response content
CleanContent = os.Getenv("DEBUG") == "true"
// maximum amount of iterations per turn
if env := os.Getenv("MAX_ITERATIONS"); env != "" {
iterations, err := strconv.Atoi(env)
if err != nil {
@@ -35,11 +48,13 @@ func init() {
MaxIterations = 3
}
// openrouter token used for all completions & model list
if OpenRouterToken = os.Getenv("OPENROUTER_TOKEN"); OpenRouterToken == "" {
log.Panic(errors.New("missing openrouter token"))
}
if Debug {
log.Warning("Debug mode enabled")
// optional exa token used for search tools
if ExaToken = os.Getenv("EXA_TOKEN"); ExaToken == "" {
log.Warning("missing exa token, web search unavailable")
}
}