Skip to content

bot

dandy.processor.bot.bot

Bot

Bases: BaseProcessor, BotServiceMixin, LlmServiceMixin, HttpServiceMixin, IntelServiceMixin, VisionServiceMixin

Source code in dandy/processor/bot/bot.py
def __init__(
        self,
        llm_randomize_seed: bool | None = None,
        llm_seed: int | None = None,
        llm_temperature: float | None = None,
        **kwargs
):
    super().__init__(
        **kwargs
    )

    self.llm_config_options.update_values(
        randomize_seed=llm_randomize_seed,
        seed=llm_seed,
        temperature=llm_temperature,
    )

description = 'Generic Bot for performing generic tasks' class-attribute instance-attribute

get_description classmethod

Source code in dandy/processor/bot/bot.py
@classmethod
def get_description(cls) -> str | None:
    if cls.description is not None:
        return cls.description

    return cls.get_llm_description()

process

Source code in dandy/processor/bot/bot.py
def process(
        self,
        *args,
        **kwargs,
) -> Any:
    if len(args) >= 1 and isinstance(args[0], PromptOrStr):
        kwargs['prompt'] = args[0]

    if len(args) == 2 and issubclass(args[1], BaseIntel):
        kwargs['intel_class'] = args[1]

    if 'prompt' in kwargs:
        return self.llm.prompt_to_intel(
            **kwargs
        )

    message = '`Bot.process` requires key word argument `prompt`.'
    raise ValueError(message)