Package org.mockserver.model
Class ConversationPredicates
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.model.ConversationPredicates
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConversationPredicatesbooleanbooleanReturns true if at least one predicate field is set.inthashCode()withContainsToolResultFor(String containsToolResultFor) withLatestMessageContains(String latestMessageContains) withLatestMessageMatches(String latestMessageMatches) withLatestMessageRole(ParsedMessage.Role latestMessageRole) withNormalization(NormalizationOptions normalization) Optional normalisation applied to the prompt text (and, for substring matching, the expected value) beforelatestMessageContains/latestMessageMatchesare evaluated.withSemanticMatchAgainst(String semanticMatchAgainst) Opt-in fuzzy semantic match: the expected meaning the latest message should express, judged by a runtime LLM.withTurnIndex(Integer turnIndex) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
ConversationPredicates
public ConversationPredicates()
-
-
Method Details
-
conversationPredicates
-
withTurnIndex
-
getTurnIndex
-
withLatestMessageContains
-
getLatestMessageContains
-
withLatestMessageMatches
-
getLatestMessageMatches
-
withLatestMessageRole
-
getLatestMessageRole
-
withContainsToolResultFor
-
getContainsToolResultFor
-
withSemanticMatchAgainst
Opt-in fuzzy semantic match: the expected meaning the latest message should express, judged by a runtime LLM. Off by default — ignored unlessmockserver.llmSemanticMatchingEnabledis set and a backend resolves. Non-deterministic; exploratory only, never for assertions. -
getSemanticMatchAgainst
-
withNormalization
Optional normalisation applied to the prompt text (and, for substring matching, the expected value) beforelatestMessageContains/latestMessageMatchesare evaluated. A modifier, not a predicate: normalisation alone does not make the matcher active — seehasAnyPredicate(). -
getNormalization
-
hasAnyPredicate
public boolean hasAnyPredicate()Returns true if at least one predicate field is set.normalizationis intentionally excluded — it only modifies how the text predicates match. -
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-