Changing the Global Default Agent
The global default agent (whose name, of course, is Marvin) uses whatever default model you’ve configured. It has a basic set of general-purpose instructions and is not equipped with any tools. To change the global default agent, assign a new agent tocontrolflow.defaults.agent
:
Changing a Flow’s Default Agent
You can also set a default agent for a specific flow. by using itsdefault_agent
parameter when decorating your flow function or creating the flow object.
research_task
and writing_task
will use the researcher
and writer
agents by default.
Agent Selection Precedence
When ControlFlow needs to assign an agent to a task, it follows this precedence:- Agents specified directly on the task (
task.agents
) - The agent specified by the flow (
@flow(default_agent=...)
) - The global default agent (
controlflow.defaults.agent
)
task1
will use theflow_agent
task2
will use thetask_agent
task3
will use theglobal_agent