Hi all, how can I provide ad-hoc guidance to an existing agent? I saw there is a context manager for
cf.instructions
, but what if I already have an agent that I'm passing into tasks? Will this bind?
m
mira
09/30/2024, 3:28 PM
What about using the Task instructions?
j
Jason
09/30/2024, 4:04 PM
That would definitely work too, but I'd love to be able to keep our tasks well scoped/defined and tweak things at the agent level
m
mira
09/30/2024, 4:22 PM
I don't think cf.instructions binds to the agent directly, maybe additionally. If you need to adjust the instructions of an agent, maybe it makes sense to create a new one (or simply overwrite the agents instructions with: agent.instructions = "... some instruction...")
j
Jeremiah
09/30/2024, 8:43 PM
Hey @Jason, for ad hoc instructions the context manager is best; neither agents nor tasks are designed for "temporary" configuration (e.g. the instructions applied are assumed to last for the life of the task/agent).
Essentially, any task that's run inside a
with cf.instructions(...)
context has those instructions appended to the prompt
Jeremiah
09/30/2024, 8:50 PM
Here are the relevant docs, welcome any suggestions for how to expand this pattern -- perhaps we can show multiple context managers being opened at different parts of a flow
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.