fix(knowledge-service): resolve semantic cache collision by partitioning content hash by traceType and PromptVersion
This commit is contained in:
@@ -85,7 +85,8 @@ public class KnowledgeService : IKnowledgeService
|
|||||||
|
|
||||||
using var dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
|
using var dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
|
||||||
var normalizedText = text.Trim();
|
var normalizedText = text.Trim();
|
||||||
var hash = ContentHasher.ComputeHash(normalizedText);
|
var hashInput = $"{normalizedText}:{traceType}:{PromptVersion}";
|
||||||
|
var hash = ContentHasher.ComputeHash(hashInput);
|
||||||
|
|
||||||
// 1. Check Cache
|
// 1. Check Cache
|
||||||
var cached = await dbContext.SemanticKnowledgeCache
|
var cached = await dbContext.SemanticKnowledgeCache
|
||||||
|
|||||||
Reference in New Issue
Block a user