Skip to content

Commit

Permalink
fixing IT
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j committed May 24, 2024
1 parent 30af264 commit e57f246
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,16 @@ void should_provide_ai_search_embedding_store() {
String content6 = "chess";
List<String> contents = asList(content1, content2, content3, content4, content5, content6);

Thread.sleep(3000);

for (String content : contents) {
TextSegment textSegment = TextSegment.from(content);
Embedding embedding = embeddingModel.embed(content).content();
embeddingStore.add(embedding, textSegment);
}
Thread.sleep(2000);

Thread.sleep(3000);

Embedding relevantEmbedding = embeddingModel.embed("fruit").content();
List<EmbeddingMatch<TextSegment>> relevant = embeddingStore.findRelevant(relevantEmbedding, 3);
assertThat(relevant).hasSize(3);
Expand Down

0 comments on commit e57f246

Please sign in to comment.