Class ContextualQueryAugmenter

java.lang.Object
org.springframework.ai.rag.generation.augmentation.ContextualQueryAugmenter
All Implemented Interfaces:
BiFunction<Query,List<Document>,Query>, QueryAugmenter

public final class ContextualQueryAugmenter extends Object implements QueryAugmenter
Augments the user query with contextual data from the content of the provided documents.

Example usage:


 QueryAugmenter augmenter = ContextualQueryAugmenter.builder()
    .allowEmptyContext(false)
    .build();
 Query augmentedQuery = augmenter.augment(query, documents);
 
Since:
1.0.0
Author:
Thomas Vitale
  • Constructor Details

    • ContextualQueryAugmenter

      public ContextualQueryAugmenter(@Nullable PromptTemplate promptTemplate, @Nullable PromptTemplate emptyContextPromptTemplate, @Nullable Boolean allowEmptyContext)
  • Method Details