compass.validation.location.DTreeJurisdictionValidator#
- class DTreeJurisdictionValidator(jurisdiction, **kwargs)[source]#
Bases:
BaseLLMCallerValidate ordinance text against a target jurisdiction
- Parameters:
jurisdiction (
compass.utilities.location.Jurisdiction) – Jurisdiction descriptor identifying expected applicability.**kwargs – Additional keyword arguments forwarded to
BaseLLMCallerfor configuring LLM temperature, timeout, or similar options.
Methods
check(content)Determine whether ordinance text matches the jurisdiction
Attributes
Key in doc.attrs where score is stored
System message for jurisdiction validation LLM calls
- META_SCORE_KEY = 'Jurisdiction Validation Score'#
Key in doc.attrs where score is stored
- SYSTEM_MESSAGE = 'You are a legal expert assisting a user with determining the scope of applicability for their legal ordinance documents.'#
System message for jurisdiction validation LLM calls
- async check(content)[source]#
Determine whether ordinance text matches the jurisdiction
The decision tree checks jurisdiction type, state, and subdivision alignment.
- Parameters:
content (
str) – Plain-text ordinance content extracted from a document.- Returns:
bool–Truewhen the decision tree concludes the ordinance is scoped to the configured jurisdiction,Falseotherwise.- Raises:
compass.exceptions.COMPASSError – Raised if the underlying LLM caller propagates an execution failure.
Notes
Empty content returns
Falsewithout invoking the LLM.