Enum Class Search.FallbackAction

java.lang.Object
java.lang.Enum<Search.FallbackAction>
com.tnsai.annotations.Search.FallbackAction
All Implemented Interfaces:
Serializable, Comparable<Search.FallbackAction>, Constable
Enclosing class:
Search

public static enum Search.FallbackAction extends Enum<Search.FallbackAction>
Fallback actions on retrieval failure.
  • Enum Constant Details

    • CONTINUE

      public static final Search.FallbackAction CONTINUE
      Continue without context
    • FAIL

      public static final Search.FallbackAction FAIL
      Throw exception
    • USE_CACHE

      public static final Search.FallbackAction USE_CACHE
      Fall back to the expired cached result for the identical retrieval, rethrowing the failure when there is none. Requires Search.cache(), and only serves an entry still within Search.maxStaleness() of its expiry — past that the original failure is rethrown, so a prolonged outage cannot keep answering from ever-older grounding.
    • RETRY_SIMPLE

      public static final Search.FallbackAction RETRY_SIMPLE
      Retry once with a punctuation-normalized query against Search.Strategy.KEYWORD, without reranking.

      When Search.rerank() is enabled the retry is still capped at Search.topN() even though no reranker runs, so losing the reranker cannot widen the injected context beyond what the healthy path would have delivered. With Search.rerank() disabled Search.topN() is unvalidated and applies to no path, primary or fallback, so the retry is bounded only by Search.topK().

  • Method Details

    • values

      public static Search.FallbackAction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Search.FallbackAction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null