Class IntentDetectionResult

java.lang.Object
org.codelibs.fess.llm.IntentDetectionResult

public class IntentDetectionResult extends Object
Represents the result of intent detection from user input. Contains the detected intent type, Fess query, and other metadata.
  • Method Details

    • getIntent

      public ChatIntent getIntent()
      Returns the detected intent type.
      Returns:
      the intent type
    • getQuery

      public String getQuery()
      Returns the Fess query string for search.
      Returns:
      the Fess query string, or null if not available
    • getDocumentUrl

      public String getDocumentUrl()
      Returns the document URL for summary intent.
      Returns:
      the document URL
    • getReasoning

      public String getReasoning()
      Returns the reasoning for the detected intent.
      Returns:
      the reasoning
    • search

      public static IntentDetectionResult search(String query, String reasoning)
      Creates a search intent result with a Fess query.
      Parameters:
      query - the Fess query string
      reasoning - the detection reasoning
      Returns:
      the search intent result
    • summary

      public static IntentDetectionResult summary(String documentUrl, String reasoning)
      Creates a summary intent result for a specific document.
      Parameters:
      documentUrl - the document URL to summarize
      reasoning - the detection reasoning
      Returns:
      the summary intent result
    • faq

      public static IntentDetectionResult faq(String query, String reasoning)
      Creates a FAQ intent result with a Fess query.
      Parameters:
      query - the Fess query string
      reasoning - the detection reasoning
      Returns:
      the FAQ intent result
    • unclear

      public static IntentDetectionResult unclear(String reasoning)
      Creates an unclear intent result when intent cannot be determined.
      Parameters:
      reasoning - the detection reasoning
      Returns:
      the unclear intent result
    • fallbackSearch

      public static IntentDetectionResult fallbackSearch(String originalMessage)
      Creates a fallback search intent when intent detection fails.
      Parameters:
      originalMessage - the original user message
      Returns:
      the fallback search intent result
    • toString

      public String toString()
      Overrides:
      toString in class Object