Tasks define the specific work an agent must perform. Key parameters include:
description: Detailed instructions for the task.expected_output: What the agent should produce.agent: The agent assigned to the task.context: (Optional) A list of previously completed Task objects. The current task will wait for these tasks to finish and use their outputs as input.output_file: (Optional) The filename where the task result should be saved.async_execution: (Optional) If True, the task runs asynchronously.
Example of a task using context:
resume_strategy_task = Task(
description="Tailor the resume using previous research and profiles.",
expected_output="An updated resume.",
agent=resume_strategist,
context=[research_task, profile_task],
output_file="tailored_resume.md"
)
resume_strategy_task = Task(
description=(
"Using the profile and job requirements obtained from "
"previous tasks, tailor the resume to highlight the most "
"relevant areas. Employ tools to adjust and enhance the "
"resume content. Make sure this is the best resume even but "
"don't make up any information. Update every section, "
"inlcuding the initial summary, work experience, skills, "
"and education. All to better reflect the candidates "
"abilities and how it matches the job posting."
),
expected_output=(
"An updated resume that effectively highlights the candidate's "
"qualifications and experiences relevant to the job."
),
output_file="tailored_resume.md",
context=[research_task, profile_task],
agent=resume_strategist
)