π·Workers
Last updated
Last updated
Workers are special type of classes, responsible for carrying out the tasks assigned by the class "Admin". They utilize tools such as internet search engines, LLMs, and document writers to perform their tasks. Additionally, they can determine which tools to use from a predefined set.
Similarly to how a large task like writing a blog is decomposed into smaller steps such as researching, drafting, and publishing, the admin can define a large task and split it into smaller tasks that are then assigned to the workers.
Workers possess attributes that facilitate the execution and completion of smaller, independent tasks.
Attribute | Optional Parameter | Description |
---|---|---|
The primary components,TaskWorker
, provide a structured way to define and execute tasks. The TaskWorker
class specializes in executing specific tasks assigned by the planner.
Below we have shown how one can initiate and run a simple admin-worker query.
role
It is a string input that defines the Functionality or Responsibility of the worker.
instructions
A paragraph about how the LLM should behave related to its role can also include the backstory and other relevant details that might aid in generating the output.
actions
Yes
This configurable parameter takes a list that lets us specify the set of tools available to the worker. The worker may or may not use these tools. If no tools are specified, or if the action list is empty, the worker defaults to the actions set by the admin.
llm
Yes
This parameter is configurable, allowing the worker to either use a specified LLM or default to the LLM designated by the admin.
max_iterations
Yes
This parameter specifies the maximum number of iterations, as an integer, allowed to achieve the objective of the given task.
force_output
Yes
This boolean parameter determines whether to force an output or answer after reaching the maximum iteration limit.