Class ConversationPredicates


public class ConversationPredicates extends ObjectWithJsonToString
Serialisable predicate descriptors for LLM conversation matching. Unlike LlmConversationMatcher (which is an evaluation-time object), this class carries only the data needed to describe predicates and survives JSON round-tripping through the MockServer HTTP API.

All fields are optional; only non-null fields are emitted in JSON.

  • Constructor Details

    • ConversationPredicates

      public ConversationPredicates()
  • Method Details

    • conversationPredicates

      public static ConversationPredicates conversationPredicates()
    • withTurnIndex

      public ConversationPredicates withTurnIndex(Integer turnIndex)
    • getTurnIndex

      public Integer getTurnIndex()
    • withLatestMessageContains

      public ConversationPredicates withLatestMessageContains(String latestMessageContains)
    • getLatestMessageContains

      public String getLatestMessageContains()
    • withLatestMessageMatches

      public ConversationPredicates withLatestMessageMatches(String latestMessageMatches)
    • getLatestMessageMatches

      public String getLatestMessageMatches()
    • withLatestMessageRole

      public ConversationPredicates withLatestMessageRole(ParsedMessage.Role latestMessageRole)
    • getLatestMessageRole

      public ParsedMessage.Role getLatestMessageRole()
    • withContainsToolResultFor

      public ConversationPredicates withContainsToolResultFor(String containsToolResultFor)
    • getContainsToolResultFor

      public String getContainsToolResultFor()
    • withSemanticMatchAgainst

      public ConversationPredicates withSemanticMatchAgainst(String semanticMatchAgainst)
      Opt-in fuzzy semantic match: the expected meaning the latest message should express, judged by a runtime LLM. Off by default — ignored unless mockserver.llmSemanticMatchingEnabled is set and a backend resolves. Non-deterministic; exploratory only, never for assertions.
    • getSemanticMatchAgainst

      public String getSemanticMatchAgainst()
    • withNormalization

      public ConversationPredicates withNormalization(NormalizationOptions normalization)
      Optional normalisation applied to the prompt text (and, for substring matching, the expected value) before latestMessageContains / latestMessageMatches are evaluated. A modifier, not a predicate: normalisation alone does not make the matcher active — see hasAnyPredicate().
    • getNormalization

      public NormalizationOptions getNormalization()
    • hasAnyPredicate

      public boolean hasAnyPredicate()
      Returns true if at least one predicate field is set. normalization is intentionally excluded — it only modifies how the text predicates match.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ObjectWithReflectiveEqualsHashCodeToString
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectWithReflectiveEqualsHashCodeToString