Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgotteiner committed Nov 6, 2024
1 parent 7cf7e3f commit b632d4c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void addAndSearchTest() {

Awaitility.await()
.until(() -> vectorStore.similaritySearch(SearchRequest.query("Great Depression").withTopK(1)),
hasSize(1));
hasSize(1));

List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Great Depression").withTopK(1));

Expand Down Expand Up @@ -210,7 +210,7 @@ public void documentUpdateTest() {
VectorStore vectorStore = context.getBean(VectorStore.class);

Document document = new Document(UUID.randomUUID().toString(), "Spring AI rocks!!",
Collections.singletonMap("meta1", "meta1"));
Collections.singletonMap("meta1", "meta1"));

vectorStore.add(List.of(document));

Expand All @@ -229,15 +229,15 @@ public void documentUpdateTest() {

Document sameIdDocument = new Document(document.getId(),
"The World is Big and Salvation Lurks Around the Corner",
Collections.singletonMap("meta2", "meta2"));
Collections.singletonMap("meta2", "meta2"));

vectorStore.add(List.of(sameIdDocument));

SearchRequest fooBarSearchRequest = SearchRequest.query("FooBar").withTopK(5);

Awaitility.await()
.until(() -> vectorStore.similaritySearch(fooBarSearchRequest).get(0).getContent(),
equalTo("The World is Big and Salvation Lurks Around the Corner"));
equalTo("The World is Big and Salvation Lurks Around the Corner"));

results = vectorStore.similaritySearch(fooBarSearchRequest);

Expand Down

0 comments on commit b632d4c

Please sign in to comment.