> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goguava.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# set_task()

> Direct the agent toward a new goal mid-call

<Tabs>
  <Tab title="Python">
    `call.set_task()` directs the agent toward a new goal mid-call. It accepts an objective, an ordered checklist of steps, and a task ID for binding completion handlers.

    ```python signature theme={null}
    call.set_task(
        task_id: str,
        objective: str = "",
        checklist: list[Field | Say | str] | None = None,
        completion_criteria: str = "",
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    `call.setTask()` directs the agent toward a new goal mid-call. It accepts an objective, an ordered checklist of steps, and a task ID for binding completion handlers.

    ```typescript signature theme={null}
    await call.setTask({
      taskId: string,
      objective?: string,
      checklist?: (FieldItem | SayItem | string)[],
      completionCriteria?: string,
    })
    ```
  </Tab>
</Tabs>

<Note>
  **Full reference:** See the [Task](/sdk-reference/tasks) page for parameter details, checklist item types, and a complete example.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.