Class Generation

java.lang.Object
dev.langchain4j.adaptiverag.Generation
All Implemented Interfaces:
BiFunction<String,List<String>,String>

public class Generation extends Object implements BiFunction<String,List<String>,String>
This class provides a service for generating answers to questions using natural language processing. It implements the BiFunction interface to process question and context inputs and produce an answer.
  • Constructor Details

    • Generation

      public Generation()
  • Method Details

    • apply

      public String apply(String question, List<String> context)
      Apply a text-based query to an AI model and retrieve the model's response.
      Specified by:
      apply in interface BiFunction<String,List<String>,String>
      Parameters:
      question - The text query to be processed by the AI model.
      context - A list of strings providing additional context to the query.
      Returns:
      The response from the AI model as a string.