πŸ‘¨β€πŸ’Ό Admin

What is an Admin?

Imagine Admin as the master task executor who is responsible for all the major configurations for the execution. From planning of tasks to execution, and defining the brain which is what LLM to use and whether or not to use memory.

Admin is the decision-maker that understand the specifications of tasks and execute them in a more human-like manner.

Attributes

The Admin class in the openagi library is a central component designed to manage and orchestrate various functionalities within the framework. Below is a detailed explanation of its components, attributes, and usage.

The Admin class in the OpenAGI framework can be considered an Agent.

AttributeOptional ParameterDescription

planner

Help us define the type of planner we can use to decompose the given task into sub tasks.

llm

Users can provide an LLM of their choosing, or use the default one.

memory

Yes

Users can initiate Admin memory, to recall and remember the task and it's response

actions

Admin can be given access to various actions to perform it's task, such as SearchAction, Github Action, etc.

output_format

Yes

Users can define the output format as either "markdown" or "raw_text"

max_steps

Yes

The number of iterations admin can perform to obtain appropriate output.

Code Snippet

from openagi.agent import Admin

admin = Admin(
    llm=llm,
    actions=actions,
    planner=planner,
)

Below we have shown how one can initiate and run a simple admin query.

# imports
from openagi.agent import Admin
from openagi.llms.openai import OpenAIModel
from openagi.planner.task_decomposer import TaskPlanner
from openagi.actions.tools.ddg_search import DuckDuckGoSearch
from openagi.memory import Memory

# Define LLM
config = OpenAIModel.load_from_env_config()
llm = OpenAIModel(config=config)

# declare the Admin
admin = Admin(
    llm=llm,
    actions=[DuckDuckGoSearch],
    planner=TaskPlanner(human_intervene=False),
    memory=Memory(),
    output_type=OutputFormat.markdown, # Defaults to markdown
)

# execute the task
res = admin.run(
            query="sample query",
            description="sample description",
            )

Last updated