Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Agents-function calling with followup question #13167

Open
1 task done
risos8200 opened this issue Apr 30, 2024 · 3 comments
Open
1 task done

[Question]: Agents-function calling with followup question #13167

risos8200 opened this issue Apr 30, 2024 · 3 comments
Labels
question Further information is requested

Comments

@risos8200
Copy link

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

I am trying to build a framework where Agents can call specific functions whenever necessary, but how do I add a functionality for it to ask follow up questions when it doesn't have all the parameters needed to call a function.

Example: Calling an email sending function using Agent Framework but the to_send address is missing in the query, in such situation, I want my agent to ask a followup question or call any additional function, instead it just ends up sending to some example email address.

@risos8200 risos8200 added the question Further information is requested label Apr 30, 2024
@logan-markewich
Copy link
Collaborator

@risos8200 You could add a tool that specifically requires input from a user when it runs

def ask_user(message: str) -> str:
  """Useful for asking a user for any required information that you are missing."""
  response = input(message).strip()
  return response
  
tool = FunctionTool.from_defaults(ask_user)

@risos8200
Copy link
Author

Thanks, that worked!

@risos8200
Copy link
Author

risos8200 commented May 5, 2024

How do I do it for web based applications? Like I want to return a response to the agent to ask for further details in my flask app. But it goes into a infinite loop of asking itself the same question and calling the ask_user function.

@logan-markewich can you please help out?

@risos8200 risos8200 reopened this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants