From 4736e43631ed21fd14741daa1dde746687d330fa Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 4 Jan 2025 18:13:13 +0300 Subject: Feat (RAG): tying tui calls to rag funcs [WIP; skip-ci] RAG itself is annoying to properly implement, plucking sentences with no context is useless. Also it should not be a part of main package, same for goes for tui. The number of global vars is absurd. --- config/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.go b/config/config.go index ce1b877..3c79564 100644 --- a/config/config.go +++ b/config/config.go @@ -8,7 +8,6 @@ import ( type Config struct { APIURL string `toml:"APIURL"` - EmbedURL string `toml:"EmbedURL"` ShowSys bool `toml:"ShowSys"` LogFile string `toml:"LogFile"` UserRole string `toml:"UserRole"` @@ -19,6 +18,11 @@ type Config struct { ToolIcon string `toml:"ToolIcon"` SysDir string `toml:"SysDir"` ChunkLimit uint32 `toml:"ChunkLimit"` + // embeddings + RAGEnabled bool `toml:"RAGEnabled"` + EmbedURL string `toml:"EmbedURL"` + HFToken string `toml:"HFToken"` + RAGDir string `toml:"RAGDir"` } func LoadConfigOrDefault(fn string) *Config { @@ -30,6 +34,7 @@ func LoadConfigOrDefault(fn string) *Config { if err != nil { fmt.Println("failed to read config from file, loading default") config.APIURL = "http://localhost:8080/v1/chat/completions" + config.RAGEnabled = false config.EmbedURL = "http://localhost:8080/v1/embiddings" config.ShowSys = true config.LogFile = "log.txt" -- cgit v1.2.3