elm.ords.process.process_county_with_logging
- async process_county_with_logging(listener, log_dir, county, text_splitter, num_urls=5, file_loader_kwargs=None, browser_semaphore=None, level='INFO', **kwargs)[source]
Retrieve ordinance document for a single county with async logs.
- Parameters:
listener (elm.ords.utilities.queued_logging.LogListener) – Active
LogListener
instance that can be passed toelm.ords.utilities.queued_logging.LocationFileLog
.log_dir (path-like) – Path to output directory to contain log file.
county (elm.ords.utilities.location.Location) – County to retrieve ordinance document for.
text_splitter (obj, optional) – Instance of an object that implements a split_text method. The method should take text as input (str) and return a list of text chunks. Langchain’s text splitters should work for this input.
num_urls (int, optional) – Number of unique Google search result URL’s to check for ordinance document. By default,
5
.file_loader_kwargs (dict, optional) – Dictionary of keyword-argument pairs to initialize
elm.web.file_loader.AsyncFileLoader
with. The “pw_launch_kwargs” key in these will also be used to initialize theelm.web.google_search.PlaywrightGoogleLinkSearch
used for the google URL search. By default,None
.browser_semaphore (asyncio.Semaphore, optional) – Semaphore instance that can be used to limit the number of playwright browsers open concurrently. If
None
, no limits are applied. By default,None
.level (str, optional) – Log level to set for retrieval logger. By default,
"INFO"
.**kwargs – Keyword-value pairs used to initialize an elm.ords.llm.LLMCaller instance.
- Returns:
elm.web.document.BaseDocument | None – Document instance for the ordinance document, or
None
if no document was found. Extracted ordinance information is stored in the document’smetadata
attribute.