Hi all, how can I provide ad-hoc guidance to an ex...
# marvin-ai
j
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
What about using the Task instructions?
j
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
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
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
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