Build your first agentic workflow in less than a minute.
cf.run()
cf.run()
function is the main entry point for ControlFlow. It creates a task, assigns it to the default agent, and runs it to completion.
Here, we create a task that generates a simple email reply, and provide the content of an email as additional context:
cf.run()
context
as necessaryAgents
are used to represent portable LLM configurations, including model choice, tools, specialized instructions, and more.
result_type
of this task is a list of labels, indicating that the agent must choose one of the provided options. This is the simplest way to create a classification task, but you can require more complex output formats as well.
result_type
to define the task’s output formatagents
to specify which agent to use for the task@cf.flow
decorator on a function with ControlFlow agents working inside it.
@cf.flow
to create a shared context for multiple taskscf.run()