Package dev.dokimos.server.entity
Class TraceEvalRule
java.lang.Object
dev.dokimos.server.entity.TraceEvalRule
A per-project rule that enqueues an online judge evaluation when an ingested span matches. The match
is by span name or by an attribute key/value (see
TraceMatchType). The rule carries the judge
configuration (evaluator name, criteria, score range, threshold) and the LlmConnection used to
call the judge. At most one rule per (project, name) pair.-
Constructor Summary
ConstructorsConstructorDescriptionTraceEvalRule(UUID projectId, String name, TraceMatchType matchType, String matchValue, LlmConnection connection, String evaluatorName, String criteria) -
Method Summary
Modifier and TypeMethodDescriptiongetId()doubledoublegetName()booleanbooleanReturns whether the given span matches this rule.voidsetConnection(LlmConnection connection) voidsetCriteria(String criteria) voidsetEnabled(boolean enabled) voidsetEvaluatorName(String evaluatorName) voidsetMatchKey(String matchKey) voidsetMatchType(TraceMatchType matchType) voidsetMatchValue(String matchValue) voidsetMaxScore(double maxScore) voidsetMinScore(double minScore) voidvoidsetTenantId(String tenantId) voidsetThreshold(Double threshold) voidStamps the rule as just modified.
-
Constructor Details
-
TraceEvalRule
public TraceEvalRule(UUID projectId, String name, TraceMatchType matchType, String matchValue, LlmConnection connection, String evaluatorName, String criteria)
-
-
Method Details
-
matches
Returns whether the given span matches this rule. ForTraceMatchType.SPAN_NAMEthe span name must equal the match value; forTraceMatchType.ATTRIBUTEthe span attribute named by the match key must be present and its string form must equal the match value.- Parameters:
span- the candidate span- Returns:
- true when the span satisfies the rule's match condition
-
getId
-
getProjectId
-
getTenantId
-
setTenantId
-
getName
-
setName
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getMatchType
-
setMatchType
-
getMatchKey
-
setMatchKey
-
getMatchValue
-
setMatchValue
-
getConnection
-
setConnection
-
getEvaluatorName
-
setEvaluatorName
-
getCriteria
-
setCriteria
-
getMinScore
public double getMinScore() -
setMinScore
public void setMinScore(double minScore) -
getMaxScore
public double getMaxScore() -
setMaxScore
public void setMaxScore(double maxScore) -
getThreshold
-
setThreshold
-
getCreatedAt
-
getUpdatedAt
-
touchUpdatedAt
public void touchUpdatedAt()Stamps the rule as just modified.
-