Interface QueryAugmenter

All Superinterfaces:
BiFunction<Query,List<org.springframework.ai.document.Document>,Query>
All Known Implementing Classes:
ContextualQueryAugmenter

public interface QueryAugmenter extends BiFunction<Query,List<org.springframework.ai.document.Document>,Query>
A component for augmenting an input query with additional data, useful to provide a large language model with the necessary context to answer the user query.
Since:
1.0.0
Author:
Thomas Vitale
  • Method Summary

    Modifier and Type
    Method
    Description
    default Query
    apply(Query query, List<org.springframework.ai.document.Document> documents)
     
    augment(Query query, List<org.springframework.ai.document.Document> documents)
    Augments the user query with contextual data.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • augment

      Query augment(Query query, List<org.springframework.ai.document.Document> documents)
      Augments the user query with contextual data.
      Parameters:
      query - The user query to augment
      documents - The contextual data to use for augmentation
      Returns:
      The augmented query
    • apply

      default Query apply(Query query, List<org.springframework.ai.document.Document> documents)
      Specified by:
      apply in interface BiFunction<Query,List<org.springframework.ai.document.Document>,Query>