fix: set "EnableSemanticCachefalse" to false when no vector configured in ai-cache (#2351)

This commit is contained in:
mirror
2025-05-30 13:38:06 +08:00
committed by GitHub
parent a73c33f1da
commit 52d0212698

View File

@@ -90,6 +90,8 @@ func (c *PluginConfig) FromJson(json gjson.Result, log wrapper.Log) {
if json.Get("enableSemanticCache").Exists() {
c.EnableSemanticCache = json.Get("enableSemanticCache").Bool()
} else if c.GetVectorProvider() == nil {
c.EnableSemanticCache = false // set value to false when no vector provider
} else {
c.EnableSemanticCache = true // set default value to true
}