My question of the day is this: Is there a control...
# marvin-ai
d
My question of the day is this: Is there a controlflow example where you do some stuff and it generates a report and then you loop and interact with it (aka, chat but with tools/memory?)
j
You can pass
interactive=True
to any task and the agent will be given a tool for interacting with a user on the command line in order to achieve the task's objective. Another approach is to collect user input however you prefer and provide it as context to the task (e.g.
response = cf.run("respond to the user", context=dict(message=user_message))
. We're looking at other idioms for collecting input directly to the thread as well
d
Should I just do some sort of while loop there?
j
yeah the way i'd think of it is if the interaction is within the scope of a single task, give the agent a tool to collect user input (or set
interactive=True
). If the need is broader or more flexible, then use a loop to collect input and create tasks that are specifically for the agent to produce a response or act on it.
Basically do you want the task's own loop to manage the interaction, or do you want to build a loop to manage the interaction
d
Thanks!
j
In a sense, a loop with tasks like
cf.run("respond to the user")
is essentially a chatbot 🙂 Probably slightly larger system message than you'd need for just that use case but not by much
👍 1