compass.extraction.solar.ordinance.SolarOrdinanceTextCollector#
- class SolarOrdinanceTextCollector(*args, **kwargs)[source]#
Bases:
StructuredLLMCaller
Check text chunks for ordinances and collect them if they do
- Parameters:
*args, **kwargs – Parameters to pass to the
StructuredLLMCaller
initializer.
Methods
call
(sys_msg, content[, usage_sub_label])Call LLM for structured data retrieval.
check_chunk
(chunk_parser, ind)Check a chunk at a given ind to see if it contains ordinance
Attributes
CONTAINS_ORD_PROMPT
IS_UTILITY_SCALE_PROMPT
Flag indicating whether text contains ordinance info
Combined ordinance text from the individual chunks
- async check_chunk(chunk_parser, ind)[source]#
Check a chunk at a given ind to see if it contains ordinance
- async call(sys_msg, content, usage_sub_label=LLMUsageCategory.DEFAULT)#
Call LLM for structured data retrieval.
- Parameters:
sys_msg (
str
) – The LLM system message. If this text does not contain the instruction text “Return your answer as a dictionary in JSON format”, it will be added.content (
str
) – LLM call content (typically some text to extract info from).usage_sub_label (
str
, optional) – Label to store token usage under. By default,"default"
.
- Returns:
dict
– Dictionary containing the LLM-extracted features. Dictionary may be empty if there was an error during the LLM call.