Package org.mockserver.mock.drift
Class SemanticDriftExtension
java.lang.Object
org.mockserver.mock.drift.SemanticDriftExtension
Optional LLM-powered extension to
DriftAnalyzer. When a configured
LLM backend is available, classifies each structural drift record as
BREAKING / WARNING / INFORMATIONAL and adds a one-sentence explanation.
Called asynchronously on the drift-analysis scheduler thread — never blocks the HTTP response path. Enrichment is best-effort: any LLM failure leaves the drift records with their original structural-only data.
-
Constructor Summary
ConstructorsConstructorDescriptionSemanticDriftExtension(LlmCompletionService completionService, LlmBackend backend) -
Method Summary
Modifier and TypeMethodDescriptionvoidenrich(List<DriftRecord> records, String expectationId, HttpResponse stubResponse, HttpResponse realResponse) Enriches drift records with semantic severity and explanation using the LLM.boolean
-
Constructor Details
-
SemanticDriftExtension
-
-
Method Details
-
isAvailable
public boolean isAvailable()- Returns:
- true if both the completion service and backend are configured.
-
enrich
public void enrich(List<DriftRecord> records, String expectationId, HttpResponse stubResponse, HttpResponse realResponse) Enriches drift records with semantic severity and explanation using the LLM. Must not block the response path — called asynchronously.
-