Nilesh Trivedi
06/28/2024, 7:46 AMrun()
method
When I use the run()
method for a task (without defining any agents), is a default agent of some kind invoked? Can I modify its behaviour/system prompt/LLM model etc? I noticed this is done using GPT-4o.Nilesh Trivedi
06/28/2024, 7:48 AMNilesh Trivedi
06/28/2024, 7:50 AMNilesh Trivedi
06/28/2024, 7:54 AMIf no agents are explicitly assigned to a task, ControlFlow will use the agents defined in a task’s parent task, flow, or fall back on a global default agent, respectively.
Jeremiah
import controlflow as cf
# create the agent with whatever config
# you want
agent = cf.Agent(<name, LLM, instructions, etc.>)
# assign the agent as the new global default here
cf.default_agent = agent
# confirm that a task created with no agents
# gets your new agent
assert agent in cf.Task('').get_agents()
Jeremiah
Nilesh Trivedi
06/29/2024, 1:31 AM