How to take back and forth human input in a single run of team instance?

Hello,

We are trying to solve a upselling use case. For that we need to communicate with user back and forth to take his user input like his name, account number, Document number required, decision to move forward etc.

While running a small POC, I’m using a while loop and running team.print_response(). But I’m assuming if in just a single run, team leader should ask for user input. Right now I’ve to execute team.print_response every time, as code terminates after printing a single message.

is_complete = False
while not is_complete:
    user_input = input("User:")
    if user_input == "bye":
        is_complete = True
    else:
        loan_upselling_team.print_response(
            user_input
        )

As of now, there is no support of team feature on Agent UI. so I’m running my POC for team feature in terminal only. I did saw pre-hook and post-hook feature, but my question is will it update the user message history as it is continous conversation between user and team. ?

Any suggestions or views are highly appreciated.

Thanks.

@Monali @monalisha @Dirk could you guys please assist me with this as this is a blocker for our work.

Hey @MahorShekhar,

Thank you for reaching out and using Agno!
I’m prioritizing your question and have shared it with the team. We’ll get back to you as soon as possible.

Appreciate your patience!

Hey @Monali . Just following up here.

I’m blocked at the moment. I would really appreciate if your team could respond to my query.

Thank you.

Hey @MahorShekhar
I am very sorry about the delay.
@monalisha will help you out here asap.

Again Apologies for the delay from our end

Hey @MahorShekhar, thanks for reaching out.
We have HITL on all functions… but if you mean pre/post hook before calling the member agent, then no we don’t yet have that.

It is on the teams list roadmap.

That said, the team leader could respond with “I need more info” and then you run again…
But in terms of an “Interrupted flow”, we don’t really support that on agents either.

So this is kind of just how agents work in general. I would very specifically instruct the agent to gather all the information with a back and forth with the user (the dev should rather use run vs print_response ) and then finally the agent can continue. We don’t have a “single run which has user input”, this is a nice use-case possibly for “Admin Flows” (which is something the team is working on)

@kausmos I see.

So lets suppose I create a team of agents. To solve a user query, may be one agent needs input from user. Let’s say agent needs to know customer id of the user to check his account information. So, right now I’m using team.run(), in this case as well, we need to run team.run() in loops to take user input back and forth, if team leader responds that it needs some customer id ?

Basically what I need is a human interactive agent that takes input from user. Any other agent can ask this human interactive agent to take input from user that is needed to run any tool call ? How would this be done ? Should I create a post-hook method to take input from user. But how will that user message will add to user role history ?

CC @Monali @monalisha

Yes @MahorShekhar , you’re right with the first part. There isn’t a lot of flexibility currently with the HITL part, we’re working on it.

At the moment your only recourse would be to just have the model go back and forth until the model has enough information.