Chore: db path to config
This commit is contained in:
3
bot.go
3
bot.go
@@ -551,8 +551,7 @@ func init() {
|
|||||||
//
|
//
|
||||||
logLevel.Set(slog.LevelInfo)
|
logLevel.Set(slog.LevelInfo)
|
||||||
logger = slog.New(slog.NewTextHandler(logfile, &slog.HandlerOptions{Level: logLevel}))
|
logger = slog.New(slog.NewTextHandler(logfile, &slog.HandlerOptions{Level: logLevel}))
|
||||||
// TODO: rename and/or put in cfg
|
store = storage.NewProviderSQL(cfg.DBPATH, logger)
|
||||||
store = storage.NewProviderSQL("test.db", logger)
|
|
||||||
if store == nil {
|
if store == nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,3 +21,4 @@ TTS_SPEED = 1.0
|
|||||||
# extra stt
|
# extra stt
|
||||||
STT_ENABLED = false
|
STT_ENABLED = false
|
||||||
STT_URL = "http://localhost:8081/inference"
|
STT_URL = "http://localhost:8081/inference"
|
||||||
|
DBPATH = "gflt.db"
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ type Config struct {
|
|||||||
// STT
|
// STT
|
||||||
STT_URL string `toml:"STT_URL"`
|
STT_URL string `toml:"STT_URL"`
|
||||||
STT_ENABLED bool `toml:"STT_ENABLED"`
|
STT_ENABLED bool `toml:"STT_ENABLED"`
|
||||||
|
DBPATH string `toml:"DBPATH"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfigOrDefault(fn string) *Config {
|
func LoadConfigOrDefault(fn string) *Config {
|
||||||
@@ -78,6 +79,7 @@ func LoadConfigOrDefault(fn string) *Config {
|
|||||||
config.AssistantRole = "assistant"
|
config.AssistantRole = "assistant"
|
||||||
config.SysDir = "sysprompts"
|
config.SysDir = "sysprompts"
|
||||||
config.ChunkLimit = 8192
|
config.ChunkLimit = 8192
|
||||||
|
config.DBPATH = "gflt.db"
|
||||||
//
|
//
|
||||||
config.RAGBatchSize = 100
|
config.RAGBatchSize = 100
|
||||||
config.RAGWordLimit = 80
|
config.RAGWordLimit = 80
|
||||||
|
|||||||
Reference in New Issue
Block a user