@@ -50,6 +50,7 @@ var _ = Describe("Cache Package", func() {
5050 SimilarityThreshold : 0.8 ,
5151 MaxEntries : 1000 ,
5252 TTLSeconds : 3600 ,
53+ EmbeddingModel : "bert" ,
5354 }
5455
5556 backend , err := cache .NewCacheBackend (config )
@@ -65,6 +66,7 @@ var _ = Describe("Cache Package", func() {
6566 SimilarityThreshold : 0.8 ,
6667 MaxEntries : 1000 ,
6768 TTLSeconds : 3600 ,
69+ EmbeddingModel : "bert" ,
6870 }
6971
7072 backend , err := cache .NewCacheBackend (config )
@@ -80,6 +82,7 @@ var _ = Describe("Cache Package", func() {
8082 SimilarityThreshold : 0.8 ,
8183 MaxEntries : 500 ,
8284 TTLSeconds : 1800 ,
85+ EmbeddingModel : "bert" ,
8386 }
8487
8588 backend , err := cache .NewCacheBackend (config )
@@ -141,6 +144,7 @@ development:
141144 SimilarityThreshold : 0.85 ,
142145 TTLSeconds : 7200 ,
143146 BackendConfigPath : milvusConfigPath ,
147+ EmbeddingModel : "bert" ,
144148 }
145149
146150 backend , err := cache .NewCacheBackend (config )
@@ -168,6 +172,7 @@ development:
168172 SimilarityThreshold : 0.8 ,
169173 TTLSeconds : 3600 ,
170174 BackendConfigPath : milvusConfigPath ,
175+ EmbeddingModel : "bert" ,
171176 }
172177
173178 backend , err := cache .NewCacheBackend (config )
@@ -184,6 +189,7 @@ development:
184189 Enabled : true ,
185190 SimilarityThreshold : 0.8 ,
186191 TTLSeconds : 3600 ,
192+ EmbeddingModel : "bert" ,
187193 }
188194
189195 backend , err := cache .NewCacheBackend (config )
@@ -201,6 +207,7 @@ development:
201207 SimilarityThreshold : - 0.8 , // invalid
202208 MaxEntries : 10 ,
203209 TTLSeconds : - 1 , // invalid
210+ EmbeddingModel : "bert" ,
204211 }
205212
206213 backend , err := cache .NewCacheBackend (config )
@@ -220,6 +227,7 @@ development:
220227 SimilarityThreshold : 0.8 ,
221228 MaxEntries : 1000 ,
222229 TTLSeconds : 3600 ,
230+ EmbeddingModel : "bert" ,
223231 EvictionPolicy : "lru" ,
224232 }
225233
@@ -246,6 +254,7 @@ development:
246254 SimilarityThreshold : 1.5 , // Invalid: > 1.0
247255 MaxEntries : 1000 ,
248256 TTLSeconds : 3600 ,
257+ EmbeddingModel : "bert" ,
249258 }
250259
251260 err := cache .ValidateCacheConfig (config )
@@ -260,6 +269,7 @@ development:
260269 SimilarityThreshold : - 0.1 , // Invalid: < 0.0
261270 MaxEntries : 1000 ,
262271 TTLSeconds : 3600 ,
272+ EmbeddingModel : "bert" ,
263273 }
264274
265275 err := cache .ValidateCacheConfig (config )
@@ -274,6 +284,7 @@ development:
274284 SimilarityThreshold : 0.8 ,
275285 MaxEntries : 1000 ,
276286 TTLSeconds : - 1 , // Invalid: negative TTL
287+ EmbeddingModel : "bert" ,
277288 }
278289
279290 err := cache .ValidateCacheConfig (config )
@@ -288,6 +299,7 @@ development:
288299 SimilarityThreshold : 0.8 ,
289300 MaxEntries : - 1 , // Invalid: negative max entries
290301 TTLSeconds : 3600 ,
302+ EmbeddingModel : "bert" ,
291303 }
292304
293305 err := cache .ValidateCacheConfig (config )
@@ -302,6 +314,7 @@ development:
302314 SimilarityThreshold : 0.8 ,
303315 MaxEntries : 1000 ,
304316 TTLSeconds : 3600 ,
317+ EmbeddingModel : "bert" ,
305318 EvictionPolicy : "random" , // unsupported
306319 }
307320
@@ -316,6 +329,7 @@ development:
316329 Enabled : true ,
317330 SimilarityThreshold : 0.8 ,
318331 TTLSeconds : 3600 ,
332+ EmbeddingModel : "bert" ,
319333 // BackendConfigPath is missing
320334 }
321335
@@ -330,6 +344,7 @@ development:
330344 Enabled : true ,
331345 SimilarityThreshold : 0.8 ,
332346 TTLSeconds : 3600 ,
347+ EmbeddingModel : "bert" ,
333348 BackendConfigPath : "/nonexistent/milvus.yaml" ,
334349 }
335350
@@ -358,6 +373,7 @@ development:
358373 SimilarityThreshold : 1.0 , // Valid: maximum threshold
359374 MaxEntries : 10000 ,
360375 TTLSeconds : 86400 ,
376+ EmbeddingModel : "bert" ,
361377 }
362378
363379 err := cache .ValidateCacheConfig (config )
@@ -416,6 +432,7 @@ development:
416432 SimilarityThreshold : 0.8 ,
417433 MaxEntries : 100 ,
418434 TTLSeconds : 300 ,
435+ EmbeddingModel : "bert" ,
419436 }
420437 inMemoryCache = cache .NewInMemoryCache (options )
421438 })
@@ -442,6 +459,7 @@ development:
442459 SimilarityThreshold : 0.8 ,
443460 MaxEntries : 100 ,
444461 TTLSeconds : 300 ,
462+ EmbeddingModel : "bert" ,
445463 }
446464 disabledCache := cache .NewInMemoryCache (disabledOptions )
447465 defer disabledCache .Close ()
@@ -509,6 +527,7 @@ development:
509527 SimilarityThreshold : 0.8 ,
510528 MaxEntries : 100 ,
511529 TTLSeconds : 1 ,
530+ EmbeddingModel : "bert" ,
512531 })
513532
514533 err := inMemoryCache .AddPendingRequest ("expired-request-id" , "test-model" , "stale query" , []byte ("request" ))
@@ -532,6 +551,7 @@ development:
532551 SimilarityThreshold : 0.99 , // Very high threshold
533552 MaxEntries : 100 ,
534553 TTLSeconds : 300 ,
554+ EmbeddingModel : "bert" ,
535555 }
536556 highThresholdCache := cache .NewInMemoryCache (highThresholdOptions )
537557 defer highThresholdCache .Close ()
@@ -582,6 +602,7 @@ development:
582602 SimilarityThreshold : 0.1 ,
583603 MaxEntries : 10 ,
584604 TTLSeconds : 1 ,
605+ EmbeddingModel : "bert" ,
585606 })
586607 defer ttlCache .Close ()
587608
@@ -621,6 +642,7 @@ development:
621642 SimilarityThreshold : 0.8 ,
622643 MaxEntries : 100 ,
623644 TTLSeconds : 300 ,
645+ EmbeddingModel : "bert" ,
624646 }
625647 disabledCache := cache .NewInMemoryCache (disabledOptions )
626648 defer disabledCache .Close ()
@@ -664,6 +686,7 @@ development:
664686 SimilarityThreshold : 0.9 ,
665687 MaxEntries : 2000 ,
666688 TTLSeconds : 7200 ,
689+ EmbeddingModel : "bert" ,
667690 BackendConfigPath : "config/cache/milvus.yaml" ,
668691 }
669692
0 commit comments