Class RagSettingsService

java.lang.Object
sk.iway.iwcm.rag.service.RagSettingsService

public class RagSettingsService extends Object
Resolves RAG settings from global constants with optional per-component overrides stored in PageParams. Empty or "auto" values keep the global configuration so existing search apps keep their default behavior.
  • Method Details

    • getSemanticMinimumSimilarity

      public static double getSemanticMinimumSimilarity(PageParams pageParams)
    • getSemanticMinimumResults

      public static int getSemanticMinimumResults(PageParams pageParams)
    • getRerankLexicalWeight

      public static double getRerankLexicalWeight()
      Resolves the text-match weight, clamping finite values and replacing invalid values with the default.
      Returns:
      weight in the range zero to one, or 0.15 for invalid or non-finite input
    • getHybridSearchMode

      public static String getHybridSearchMode(PageParams pageParams)
      Resolves the hybrid retrieval mode, using global configuration for empty or automatic component values.
      Parameters:
      pageParams - optional component settings
      Returns:
      trimmed mode, or an empty string when no value is available
    • getHybridShortQueryMaxChars

      public static int getHybridShortQueryMaxChars(PageParams pageParams)
    • getHybridShortQueryMaxTerms

      public static int getHybridShortQueryMaxTerms(PageParams pageParams)
    • getHybridFallbackTopSimilarity

      public static double getHybridFallbackTopSimilarity(PageParams pageParams)
    • getHybridVectorWeight

      public static double getHybridVectorWeight(PageParams pageParams)
    • getHybridFtsWeight

      public static double getHybridFtsWeight(PageParams pageParams)
    • getHybridChunkFetchMultiplier

      public static int getHybridChunkFetchMultiplier(PageParams pageParams)
    • getHybridFtsUseIlikeFallback

      public static boolean getHybridFtsUseIlikeFallback(PageParams pageParams)
      Resolves whether full-text retrieval may fall back to a database-specific text-pattern search. Recognizes component values true, trueValue, false, and falseValue; other values retain the global setting.
      Parameters:
      pageParams - optional component settings
      Returns:
      whether the full-text fallback is enabled
    • getHybridRrfK

      public static int getHybridRrfK(PageParams pageParams)
    • getRagAnswerMinSimilarity

      public static double getRagAnswerMinSimilarity(PageParams pageParams)
    • getRagAnswerTopK

      public static int getRagAnswerTopK(PageParams pageParams)
    • getRagAnswerMaxChunkGap

      public static int getRagAnswerMaxChunkGap(PageParams pageParams)
    • getRagAnswerMaxBlocks

      public static int getRagAnswerMaxBlocks(PageParams pageParams)
    • getRagAnswerMaxCharacters

      public static int getRagAnswerMaxCharacters(PageParams pageParams)
    • getRagAnswerMaxMergedBlockCharacters

      public static int getRagAnswerMaxMergedBlockCharacters(PageParams pageParams)
    • isHybridSearchEnabled

      public static boolean isHybridSearchEnabled(PageParams pageParams)
      Combines the global hybrid-search switch with the component's retrieval mode and search type. An off mode disables hybrid retrieval; empty or automatic search types retain the global switch.
      Parameters:
      pageParams - optional component settings
      Returns:
      true when hybrid search is globally enabled and the component selection permits it
    • isAnswerAllowed

      public static boolean isAnswerAllowed(PageParams pageParams)
      Applies the global answer-generation gate and the component's optional answer preference. Empty or automatic preferences retain the global setting; unrecognized preferences disable answers.
      Parameters:
      pageParams - optional component settings
      Returns:
      true when answer generation is enabled globally and allowed by the component