Skip to content

Commit

Permalink
fix: update javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Jan 5, 2025
1 parent c5c8e88 commit 3ed2659
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<version>3.11.2</version>
<configuration>
<failOnWarnings>false</failOnWarnings>
<failOnError>false</failOnError>
<doclint>none</doclint>
</configuration>
<reportSets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import static org.bsc.langgraph4j.utils.CollectionsUtils.listOf;
import static org.bsc.langgraph4j.utils.CollectionsUtils.mapOf;

/**
* AdaptiveRag
*/
@Slf4j( topic="AdaptiveRag")
public class AdaptiveRag {

Expand Down Expand Up @@ -60,15 +63,23 @@ public List<String> documents() {
@Getter(lazy = true)
private final ChromaStore chroma = openChroma();

public AdaptiveRag( String openApiKey, String tavilyApiKey ) {
/**
* Constructor for the AdaptiveRag class.
*
* @param openApiKey The API key for OpenAI, used for accessing its services.
* @param tavilyApiKey The API key for Tavily, used for web search functionality.
*
* This constructor initializes the AdaptiveRag instance by validating the provided API keys.
* Both keys are required for the functionality of this class. If either key is null,
* an exception is thrown. This ensures that the AdaptiveRag instance is always properly configured.
*/
public AdaptiveRag(String openApiKey, String tavilyApiKey) {
Objects.requireNonNull(openApiKey, "no OPENAI APIKEY provided!");
Objects.requireNonNull(tavilyApiKey, "no TAVILY APIKEY provided!");
this.openApiKey = openApiKey;
this.tavilyApiKey = tavilyApiKey;
//this.chroma = ChromaStore.of(openApiKey);

// The ChromaStore instance is lazily initialized when accessed via the getChroma() method.
}

private ChromaStore openChroma() {
return ChromaStore.of(openApiKey);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* This class implements a {@link Function} to rewrite questions for better vectorstore retrieval.
* It uses an AI language model to rephrase input questions based on semantic intent and meaning.
*
* @Value(staticConstructor="of")
*/
@Value(staticConstructor="of")
public class QuestionRewriter implements Function<String, String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
/**
* The RetrievalGrader class implements a function to assess the relevance of a retrieved document
* to a user's question. It uses an AI service to generate a binary score ('yes' or 'no') indicating relevance.
*
* @implNote This class relies on external services for processing and grading documents, making it dependent
* on network availability and the stability of the used API.
* This class relies on external services for processing and grading documents, making it dependent
* on network availability and the stability of the used API.
*/
@Value(staticConstructor="of")
public class RetrievalGrader implements Function<RetrievalGrader.Arguments, RetrievalGrader.Score> {
Expand Down

0 comments on commit 3ed2659

Please sign in to comment.