SemanticCache constructor
SemanticCache({
- required DocumentStore store,
- required Embedder embedder,
- String namespace = 'default',
- double threshold = 0.95,
- Duration? ttl,
Creates a cache.
Implementation
SemanticCache({
required this.store,
required this.embedder,
this.namespace = 'default',
this.threshold = 0.95,
this.ttl,
}) {
if (store.dimensions != embedder.dimensions) {
throw ArgumentError(
'the store holds ${store.dimensions}-dimensional vectors but the '
'embedder produces ${embedder.dimensions}',
);
}
}