@@ -51,6 +51,7 @@ var _ = Describe("Cache Package", func() {
5151						SimilarityThreshold : 0.8 ,
5252						MaxEntries :          1000 ,
5353						TTLSeconds :          3600 ,
54+ 						EmbeddingModel :      "bert" ,
5455					}
5556
5657					backend , err  :=  cache .NewCacheBackend (config )
@@ -66,6 +67,7 @@ var _ = Describe("Cache Package", func() {
6667						SimilarityThreshold : 0.8 ,
6768						MaxEntries :          1000 ,
6869						TTLSeconds :          3600 ,
70+ 						EmbeddingModel :      "bert" ,
6971					}
7072
7173					backend , err  :=  cache .NewCacheBackend (config )
@@ -81,6 +83,7 @@ var _ = Describe("Cache Package", func() {
8183						SimilarityThreshold : 0.8 ,
8284						MaxEntries :          500 ,
8385						TTLSeconds :          1800 ,
86+ 						EmbeddingModel :      "bert" ,
8487					}
8588
8689					backend , err  :=  cache .NewCacheBackend (config )
@@ -142,6 +145,7 @@ development:
142145						SimilarityThreshold : 0.85 ,
143146						TTLSeconds :          7200 ,
144147						BackendConfigPath :   milvusConfigPath ,
148+ 						EmbeddingModel :      "bert" ,
145149					}
146150
147151					backend , err  :=  cache .NewCacheBackend (config )
@@ -169,6 +173,7 @@ development:
169173						SimilarityThreshold : 0.8 ,
170174						TTLSeconds :          3600 ,
171175						BackendConfigPath :   milvusConfigPath ,
176+ 						EmbeddingModel :      "bert" ,
172177					}
173178
174179					backend , err  :=  cache .NewCacheBackend (config )
@@ -223,6 +228,7 @@ connection:
223228						Enabled :             true ,
224229						SimilarityThreshold : 0.8 ,
225230						TTLSeconds :          3600 ,
231+ 						EmbeddingModel :      "bert" ,
226232					}
227233
228234					backend , err  :=  cache .NewCacheBackend (config )
@@ -240,6 +246,7 @@ connection:
240246						SimilarityThreshold : - 0.8 , // invalid 
241247						MaxEntries :          10 ,
242248						TTLSeconds :          - 1 , // invalid 
249+ 						EmbeddingModel :      "bert" ,
243250					}
244251
245252					backend , err  :=  cache .NewCacheBackend (config )
@@ -259,6 +266,7 @@ connection:
259266					SimilarityThreshold : 0.8 ,
260267					MaxEntries :          1000 ,
261268					TTLSeconds :          3600 ,
269+ 					EmbeddingModel :      "bert" ,
262270					EvictionPolicy :      "lru" ,
263271				}
264272
@@ -285,6 +293,7 @@ connection:
285293					SimilarityThreshold : 1.5 , // Invalid: > 1.0 
286294					MaxEntries :          1000 ,
287295					TTLSeconds :          3600 ,
296+ 					EmbeddingModel :      "bert" ,
288297				}
289298
290299				err  :=  cache .ValidateCacheConfig (config )
@@ -299,6 +308,7 @@ connection:
299308					SimilarityThreshold : - 0.1 , // Invalid: < 0.0 
300309					MaxEntries :          1000 ,
301310					TTLSeconds :          3600 ,
311+ 					EmbeddingModel :      "bert" ,
302312				}
303313
304314				err  :=  cache .ValidateCacheConfig (config )
@@ -313,6 +323,7 @@ connection:
313323					SimilarityThreshold : 0.8 ,
314324					MaxEntries :          1000 ,
315325					TTLSeconds :          - 1 , // Invalid: negative TTL 
326+ 					EmbeddingModel :      "bert" ,
316327				}
317328
318329				err  :=  cache .ValidateCacheConfig (config )
@@ -327,6 +338,7 @@ connection:
327338					SimilarityThreshold : 0.8 ,
328339					MaxEntries :          - 1 , // Invalid: negative max entries 
329340					TTLSeconds :          3600 ,
341+ 					EmbeddingModel :      "bert" ,
330342				}
331343
332344				err  :=  cache .ValidateCacheConfig (config )
@@ -341,6 +353,7 @@ connection:
341353					SimilarityThreshold : 0.8 ,
342354					MaxEntries :          1000 ,
343355					TTLSeconds :          3600 ,
356+ 					EmbeddingModel :      "bert" ,
344357					EvictionPolicy :      "random" , // unsupported 
345358				}
346359
@@ -355,6 +368,7 @@ connection:
355368					Enabled :             true ,
356369					SimilarityThreshold : 0.8 ,
357370					TTLSeconds :          3600 ,
371+ 					EmbeddingModel :      "bert" ,
358372					// BackendConfigPath is missing 
359373				}
360374
@@ -369,6 +383,7 @@ connection:
369383					Enabled :             true ,
370384					SimilarityThreshold : 0.8 ,
371385					TTLSeconds :          3600 ,
386+ 					EmbeddingModel :      "bert" ,
372387					BackendConfigPath :   "/nonexistent/milvus.yaml" ,
373388				}
374389
@@ -397,6 +412,7 @@ connection:
397412					SimilarityThreshold : 1.0 , // Valid: maximum threshold 
398413					MaxEntries :          10000 ,
399414					TTLSeconds :          86400 ,
415+ 					EmbeddingModel :      "bert" ,
400416				}
401417
402418				err  :=  cache .ValidateCacheConfig (config )
@@ -455,6 +471,7 @@ connection:
455471				SimilarityThreshold : 0.8 ,
456472				MaxEntries :          100 ,
457473				TTLSeconds :          300 ,
474+ 				EmbeddingModel :      "bert" ,
458475			}
459476			inMemoryCache  =  cache .NewInMemoryCache (options )
460477		})
@@ -481,6 +498,7 @@ connection:
481498				SimilarityThreshold : 0.8 ,
482499				MaxEntries :          100 ,
483500				TTLSeconds :          300 ,
501+ 				EmbeddingModel :      "bert" ,
484502			}
485503			disabledCache  :=  cache .NewInMemoryCache (disabledOptions )
486504			defer  disabledCache .Close ()
@@ -548,6 +566,7 @@ connection:
548566				SimilarityThreshold : 0.8 ,
549567				MaxEntries :          100 ,
550568				TTLSeconds :          1 ,
569+ 				EmbeddingModel :      "bert" ,
551570			})
552571
553572			err  :=  inMemoryCache .AddPendingRequest ("expired-request-id" , "test-model" , "stale query" , []byte ("request" ))
@@ -571,6 +590,7 @@ connection:
571590				SimilarityThreshold : 0.99 , // Very high threshold 
572591				MaxEntries :          100 ,
573592				TTLSeconds :          300 ,
593+ 				EmbeddingModel :      "bert" ,
574594			}
575595			highThresholdCache  :=  cache .NewInMemoryCache (highThresholdOptions )
576596			defer  highThresholdCache .Close ()
@@ -621,6 +641,7 @@ connection:
621641				SimilarityThreshold : 0.1 ,
622642				MaxEntries :          10 ,
623643				TTLSeconds :          1 ,
644+ 				EmbeddingModel :      "bert" ,
624645			})
625646			defer  ttlCache .Close ()
626647
@@ -660,6 +681,7 @@ connection:
660681				SimilarityThreshold : 0.8 ,
661682				MaxEntries :          100 ,
662683				TTLSeconds :          300 ,
684+ 				EmbeddingModel :      "bert" ,
663685			}
664686			disabledCache  :=  cache .NewInMemoryCache (disabledOptions )
665687			defer  disabledCache .Close ()
@@ -703,6 +725,7 @@ connection:
703725				SimilarityThreshold : 0.9 ,
704726				MaxEntries :          2000 ,
705727				TTLSeconds :          7200 ,
728+ 				EmbeddingModel :      "bert" ,
706729				BackendConfigPath :   "config/cache/milvus.yaml" ,
707730			}
708731
0 commit comments