Conversation
|
@Jacopo47 Thanks for the great work! I'm wondering if we should use |
There was a problem hiding this comment.
@Jacopo47 Thank you!
Could you please add Builder pattern and some javadoc in the constructor and class to clarify the meaing of parameters in the constructor.
BTW, to make spotless happy, please run make format. Thank you!
|
|
||
| import java.util.UUID; | ||
|
|
||
| class RedisVectorSetsEmbeddingStoreRemovalIT extends EmbeddingStoreWithRemovalIT { |
There was a problem hiding this comment.
copy-paste issue in filename, should be RedisVectorSetsEmbeddingStoreRemovalIT.java
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
|
||
| public class RedisVectorSetsEmbeddingStoreIT implements AutoCloseable { |
There was a problem hiding this comment.
Please extend it with EmbeddingStoreIT or EmbeddingStoreWithFilteringIT
There was a problem hiding this comment.
nit: could be simplified with:
var joined = i
.stream()
.map(e -> {
if (e == null) {
return null;
} else if (e instanceof String s) {
return toString(s);
} else if (e instanceof UUID s){
return toString(s);
} else {
return e.toString();
}
})
.filter(Objects::nonNull)
.collect(Collectors.joining(","));There was a problem hiding this comment.
Thanks! Makes sense to me!
Fixed
There was a problem hiding this comment.
duplicate filter.isPresent() check here.
There was a problem hiding this comment.
I think throwing an exception when there are no matching elements seems a bit too harsh. Wouldn't it be better to just return an empty list?
There was a problem hiding this comment.
It should never throw an exception because if keep only Optional that actually has a value
BUT I agree with you that it's a bit too cruel so I changed it in:
List<EmbeddingMatch<TextSegment>> matches = similarElements
.entrySet()
.stream()
.map(this::mapToEmbeddingMatch)
.flatMap(Optional::stream)|
Hi, @Martin7-1 |
|
Hi @Martin7-1 ,
Because I would understand if these situation can be addressed by Redis it self or some "walk around" must be made by the embedding store. |
|
Great! No worry! Just ping me once you complete all tasks. |
Issue
Closes #393
Change
General checklist
Checklist for adding new maven module
pom.xmlandlangchain4j-community-bom/pom.xmlChecklist for adding new embedding store integration
{NameOfIntegration}EmbeddingStoreITthat extends from eitherEmbeddingStoreITorEmbeddingStoreWithFilteringIT{NameOfIntegration}EmbeddingStoreRemovalITthat extends fromEmbeddingStoreWithRemovalITChecklist for changing existing embedding store integration
{NameOfIntegration}EmbeddingStoreworks correctly with the data persisted using the latest released version of LangChain4j