Allow to skip indexing

This commit is contained in:
mudler
2024-04-10 19:42:54 +02:00
parent 82ac74ac5d
commit 437da44590

View File

@@ -27,6 +27,7 @@ var testModel = os.Getenv("TEST_MODEL")
var apiURL = os.Getenv("API_URL") var apiURL = os.Getenv("API_URL")
var apiKey = os.Getenv("API_KEY") var apiKey = os.Getenv("API_KEY")
var vectorStore = os.Getenv("VECTOR_STORE") var vectorStore = os.Getenv("VECTOR_STORE")
var kbdisableIndexing = os.Getenv("KBDISABLEINDEX")
const defaultChunkSize = 4098 const defaultChunkSize = 4098
@@ -80,9 +81,11 @@ func main() {
panic(err) panic(err)
} }
// Reload store if len(db.Database) > 0 && kbdisableIndexing != "true" {
if err := db.SaveToStore(); err != nil { fmt.Println("Loading knowledgebase from disk, to skip run with KBDISABLEINDEX=true")
fmt.Println("Error storing in the KB", err) if err := db.SaveToStore(); err != nil {
fmt.Println("Error storing in the KB", err)
}
} }
app := &App{ app := &App{