Class QuestionRouter

java.lang.Object
dev.langchain4j.adaptiverag.QuestionRouter
All Implemented Interfaces:
Function<String,QuestionRouter.Type>

public class QuestionRouter extends Object implements Function<String,QuestionRouter.Type>
Router for user queries to the most relevant datasource.
  • Constructor Details

    • QuestionRouter

      public QuestionRouter()
  • Method Details

    • apply

      public QuestionRouter.Type apply(String question)
      Applies a given question to an AI model and extracts the data source from the response.
      Specified by:
      apply in interface Function<String,QuestionRouter.Type>
      Parameters:
      question - The question to be applied to the AI model.
      Returns:
      The extracted data source from the model's response.