Package org.mockserver.llm.semantic
Class SemanticMatching
java.lang.Object
org.mockserver.llm.semantic.SemanticMatching
Process-wide opt-in gate for semantic prompt matching. A
SemanticPromptMatcher
is installed only when the operator sets mockserver.llmSemanticMatchingEnabled
AND a runtime LLM backend resolves (done at server start). Until then
isEnabled() is false and the semanticMatch conversation
predicate is ignored — deterministic matching is never affected by default.
This is deliberately a static holder (like the telemetry and metrics holders) so the matcher on the request path can consult it without constructor wiring.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()static voidinstall(SemanticPromptMatcher semanticPromptMatcher) static booleanTrue only when semantic matching has been explicitly enabled and wired.static booleanEvaluate the semantic match.
-
Method Details
-
install
-
clear
public static void clear() -
isEnabled
public static boolean isEnabled()True only when semantic matching has been explicitly enabled and wired. -
matches
Evaluate the semantic match. Returns false (fail-closed) when not enabled or on any error — callers should guard withisEnabled()to distinguish "disabled, ignore the predicate" from "enabled, did not match".
-