compass.plugin.ordinance.BaseTextExtractor#
- class BaseTextExtractor(llm_service, usage_tracker=None, **kwargs)[source]#
Bases:
BaseLLMCaller,ABCExtract succinct extraction text from input
- Parameters:
llm_service (
Service) – LLM service used for queries.usage_tracker (
UsageTracker, optional) – Optional tracker instance to monitor token usage during LLM calls. By default,None.**kwargs –
Keyword arguments to be passed to the underlying service processing function (i.e.
llm_service.call(**kwargs)). Should not contain the following keys:usage_sub_label
messages
These arguments are provided by this caller object.
Methods
Attributes
Identifier for text ingested by this class
Identifier for final text extracted by this class
Task description to show in progress bar
ID to use for this extraction for linking with LLM configs
Generator of (key, extractor) pairs
- TASK_DESCRIPTION = 'Condensing text for extraction'#
Task description to show in progress bar
- TASK_ID = 'text_extraction'#
ID to use for this extraction for linking with LLM configs
- abstract property parsers#
Generator of (key, extractor) pairs
extractor should be an async callable that accepts a list of text chunks and returns the shortened (succinct) text to be used for extraction. The key should be a string identifier for the text returned by the extractor. Multiple (key, extractor) pairs can be chained in generator order to iteratively refine the text for extraction.
- Type:
Generator