Skip to content

Tasks

A Task is a discrete assignment or job for an Agent to execute. Tasks contain a description of the work, expected output, optional input requirements, and references to tools or data.

Represents a discrete assignment or objective for an Agent.

Source code in fsdk/anote-sdk.py
class Task:
    """
    Represents a discrete assignment or objective for an Agent.
    """

    def __init__(
        self,
        instructions: str,
        files_uploaded: Optional[List[str]] = None,
        examples: Optional[List[str]] = None,
        expected_output: str = "",
        agent: Optional[Agent] = None
    ):
        """
        Args:
            instructions (str): The main prompt or directive for the Agent.
            files_uploaded (list of str, optional): File paths or IDs relevant to the Task (e.g., PDFs, CSVs).
            examples (list, optional): Few-shot examples or reference data.
            expected_output (str): Form or content of the final result (e.g., 'Return a markdown summary').
            agent (Agent, optional): The Agent assigned to this Task.
        """
        self.instructions = instructions
        self.files_uploaded = files_uploaded or []
        self.examples = examples or []
        self.expected_output = expected_output
        self.agent = agent

    def __repr__(self):
        return f"<Task instructions={self.instructions[:25]}... expected_output={self.expected_output[:25]}...>"

__init__(instructions, files_uploaded=None, examples=None, expected_output='', agent=None)

Parameters:

Name Type Description Default
instructions str

The main prompt or directive for the Agent.

required
files_uploaded list of str

File paths or IDs relevant to the Task (e.g., PDFs, CSVs).

None
examples list

Few-shot examples or reference data.

None
expected_output str

Form or content of the final result (e.g., 'Return a markdown summary').

''
agent Agent

The Agent assigned to this Task.

None
Source code in fsdk/anote-sdk.py
def __init__(
    self,
    instructions: str,
    files_uploaded: Optional[List[str]] = None,
    examples: Optional[List[str]] = None,
    expected_output: str = "",
    agent: Optional[Agent] = None
):
    """
    Args:
        instructions (str): The main prompt or directive for the Agent.
        files_uploaded (list of str, optional): File paths or IDs relevant to the Task (e.g., PDFs, CSVs).
        examples (list, optional): Few-shot examples or reference data.
        expected_output (str): Form or content of the final result (e.g., 'Return a markdown summary').
        agent (Agent, optional): The Agent assigned to this Task.
    """
    self.instructions = instructions
    self.files_uploaded = files_uploaded or []
    self.examples = examples or []
    self.expected_output = expected_output
    self.agent = agent

Tasks Fields

  • instructions: The main prompt or directive (e.g., "Summarize Q3 earnings").
  • files_uploaded: File paths or IDs relevant to the Task (e.g., ["report_Q3_2023.pdf"]).
  • examples: Optional few-shot examples or reference data.
  • expected_output: The form or content of the final result (e.g., "Return a markdown summary").
  • agent: The Agent to which this Task is assigned.

Example 1:

from anote_agents import Task

task = Task(
    instructions="Summarize the Q3 earnings from the attached PDF.",
    files_uploaded=["report_Q3_2023.pdf"],
    examples=["In Q2, we saw a 12% increase in revenue..."],
    expected_output="Short text summary with key figures.",
    agent=None
)

Examples of Task Usage

A task could be used to do things such as scheduling Find the best meeting times with {participant_count} participants. or research Gather references on quantum computing breakthroughs since 2020. If using structured outputs, define output_json for validation.

Example 2:

from anote_agents import Task

data_analysis_task = Task(
    description="Analyze historical sales data for the past 3 years",
    expected_output="A summary of key sales trends, plus any anomalies found.",
    human_input=False,
    agent=None  # Agent can be assigned later
)