PrefectHQ / ControlFlow

🦾 Take control of your AI agents
https://controlflow.ai
Apache License 2.0
593 stars 40 forks source link

Add Agent.say() method (or similar) #269

Open jlowin opened 4 weeks ago

jlowin commented 4 weeks ago

Enhancement Description

Currently, invoking an agent requires all the overhead of creating and completing a task. Sometimes we may want to guide an agent by prompting it with specific information. in this case, it would be great to say something to an agent.

At a minimum, this could add a user message to the flow (which could also be done as a direct flow attribute, but we could record that the specific agent was the intended target of the message, which would otherwise be public). More useful would be to also invoke the agent for one turn to get it to respond and, in doing so, add knowledge to the thread history.

Use Case

No response

Proposed Implementation

import controlflow as cf

agent = cf.Agent("Norbert")
agent.instruct('hello, from now on call me Arthur') # no response
reply = agent.say('hello') # gets a response