Skip to content

Commit

Permalink
disabling azure search with reranker by default
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j committed May 24, 2024
1 parent 1a9494e commit 8f3ce5c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import dev.langchain4j.store.embedding.EmbeddingStore;
import dev.langchain4j.store.embedding.azure.search.AzureAiSearchEmbeddingStore;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigurations;
Expand Down Expand Up @@ -141,6 +142,16 @@ void should_provide_ai_search_retriever() {
assertThat(relevant3.get(0).textSegment().text()).isEqualTo("The house is open");
log.info("#1 relevant item: {}", relevant3.get(0).textSegment().text());
});
}

@Test
@EnabledIfEnvironmentVariable(named = "AZURE_SEARCH_RERANKER_AVAILABLE", matches = "true")
void should_provide_ai_search_retriever_with_reranking() {

searchIndexClient.deleteIndex(DEFAULT_INDEX_NAME);

String content = "house";
Query query = Query.from(content);

contextRunner
.withPropertyValues(
Expand Down

0 comments on commit 8f3ce5c

Please sign in to comment.