An Engine is a system that sets up and runs specific processes to perform handler. It organizes different handler functions and uses a given prompt along with a language model to activate them. Essentially, the engine helps manage and trigger these processes to carry out actions based on the instructions it receives.

Parameters

AttributeParametersDescription
HandlerhandlerImplementation of BaseHandler, it method(s) will be executed based on the given prompts.
LLM ClientllmInterface for communicating with the large language model (LLM).
Prompt Templateprompt_templateDefines the structure and format of prompts sent to the LLM using PromptTemplate.
Tools (optional)toolsList of handler method names (as dictionaries or strings) available for use during interactions. Defaults to None. If nothing provide Engine will get it dynamically using dir(handler).
Output Parser (optional)output_parserAn optional parser to format and process the handler tools output. Defaults to None.
from superagentx.engine import Engine

walmart_engine = Engine(
    handler=walmart_ecom_handler,
    llm=llm_client,
    prompt_template=prompt_template,
    tools=None,
    output_parser=None,
)