Skip to content

BaseLlmProcessor

dandy.llm.processor.llm_processor.BaseLlmProcessor

Bases: BaseProcessor, ABC, Generic[IntelType]

config instance-attribute

config_options instance-attribute

instructions_prompt instance-attribute

intel_class instance-attribute

__init_subclass__

Source code in dandy/llm/processor/llm_processor.py
def __init_subclass__(cls):
    super().__init_subclass__()
    for attr in ['config', 'config_options', 'instructions_prompt', 'intel_class']:
        if getattr(cls, attr) is None:
            raise DandyCriticalException(f'{cls.__name__} {attr} is not set')

process_prompt_to_intel abstractmethod classmethod

Source code in dandy/llm/processor/llm_processor.py
@classmethod
@abstractmethod
def process_prompt_to_intel(
        cls,
        *args,
        **kwargs,
) -> IntelType:
    raise NotImplementedError

process_to_future classmethod

Source code in dandy/llm/processor/llm_processor.py
@classmethod
def process_to_future(cls, *args, **kwargs) -> AsyncFuture[IntelType]:
    return AsyncFuture[IntelType](cls.process, *args, **kwargs)