Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is there a way to limit the number of questions a user is allowed to ask my conversation agent?

I'm just starting out and created a conversation agent with the Agent Builder. Everything is working well so far, but I'm curious if I'm able to put a limit on the number of queries a user asks. I have two reasons for this:

1. Limiting cost

2. Use it as a "trial" version to show users what the chatbot can do.

0 1 116
1 REPLY 1

Hi @filmfrenzy,

Welcome to Google Cloud Community!

Here are some approaches you can consider to address your issue:

  1. Quotas in Vertex AI Agent Builder:
  • Google Cloud does enforce quotas on Vertex AI Agent Builder API requests. This means there are limits on how many API calls your agent can make within a given time period.
  1. Application-Level Limitations (Implementing Question Limits):
  • To limit the number of questions a user can ask, you'll likely need to implement custom logic within your agent. This would involve:
    • Session Management: Tracking the user's conversation state.
    • Counters: Storing a count of the user's questions.
    • Conditional Logic: Checking the counter and providing a "limit reached" response.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.