Tasks
Tasks are our smallest functioning unit/node that helps you define what do you want to get done by the agent. It combines agent & tools.
Description
The Task
object initialization configures a specific operation or activity to be performed within the system, encompassing a broad spectrum of functionalities from content generation to data processing. This configuration includes defining the task’s name, assigning an agent with a specific role or capability, setting input and output types, and specifying operational details such as instructions and default inputs. Additional settings may control logging and feature enhancements.
Parameter Table
The unique identifier or descriptive name for the task, highlighting its primary focus or objective.
The agent instance responsible for carrying out the task, equipped with the necessary skills or functionalities. Instance of Agent class.
Specifies the format or type of the task’s output, ensuring compatibility with subsequent operations or requirements. Accepts (OutputType.TEXT / OutputType.IMAGE).
Defines the expected format or type of input the task requires, aligning with the nature of the data being processed. (InputType.TEXT / InputType.IMAGE).
(Optional) A reference to a the llm model. Instance of AIModel (OpenAIModel/PerplexityModel) class.
Detailed guidance or commands that the agent follows to execute the task, potentially including objectives and constraints.
A boolean value indicating whether the task’s outputs should be streamed to logger.
A boolean flag enabling additional processing or modification of the initial instructions to optimize task performance. (Automatically enhances prompts based on https://arxiv.org/pdf/2312.16171.pdf paper).
A predefined input value used when actual input is unavailable or incomplete, ensuring task continuity.
Tool is an instance of Tool class to do external software actions using llm flow. For example, an email sending tool.
Input tasks instances of Task class. It is for explicitly mentioning which tasks output to be used as input for the current task.
Let’s look at an example, on how you can define a task
Let’s look at an example, on how you can create a tool task