Skip to content

Commit

Permalink
feat : enable metadata filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Jul 6, 2024
1 parent 8e8b314 commit 6848740
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public AIChatResponse queryEmbeddingStore(String question, Integer userId) {
}
EmbeddingSearchRequest embeddingSearchRequest = embeddingSearchRequestBuilder.build();
EmbeddingSearchResult<TextSegment> relevant = embeddingStore.search(embeddingSearchRequest);
EmbeddingMatch<TextSegment> embeddingMatch = relevant.matches().get(0);
EmbeddingMatch<TextSegment> embeddingMatch = relevant.matches().getFirst();

LOGGER.info("Score : {}", embeddingMatch.score()); // 0.8144288608390052
String answer = embeddingMatch.embedded().text();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.learning.ai.config.AbstractIntegrationTest;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

class TestQueryController extends AbstractIntegrationTest {
Expand All @@ -21,7 +20,6 @@ void queryEmbeddedStore() throws Exception {
}

@Test
@Disabled("Fixed in later version of langchain4j > 0.30.0")
void queryEmbeddedStoreWithMetadata() throws Exception {
mockMvc.perform(get("/api/ai/query")
.param("question", "What is your favourite sport")
Expand Down

0 comments on commit 6848740

Please sign in to comment.