Class CompressionQueryTransformer

java.lang.Object
org.springframework.ai.rag.preretrieval.query.transformation.CompressionQueryTransformer
All Implemented Interfaces:
Function<Query,Query>, QueryTransformer

public class CompressionQueryTransformer extends Object implements QueryTransformer
Uses a large language model to compress a conversation history and a follow-up query into a standalone query that captures the essence of the conversation.

This transformer is useful when the conversation history is long and the follow-up query is related to the conversation context.

Since:
1.0.0
Author:
Thomas Vitale
  • Constructor Details

    • CompressionQueryTransformer

      public CompressionQueryTransformer(org.springframework.ai.chat.client.ChatClient.Builder chatClientBuilder, @Nullable org.springframework.ai.chat.prompt.PromptTemplate promptTemplate)
  • Method Details