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

where to find the python sdk codes for developing agent in vertex ai agent builder

Hi everyone,

I am working on creating an AI chatbot that can answer questions based on both custom data and the model's general knowledge. When I create an app using the Vertex AI Agent Builder, it uses Dialogflow to create the agent, and it works well in the console. However, I am currently developing a mobile app and want to integrate this chatbot into the app. I couldn’t find the necessary code or instructions to integrate the created agent into the mobile application.

Can anyone help or provide guidance on how to do this integration?

2 1 204
1 REPLY 1

Hi @vishnuvn ,

Welcome to Google Cloud Community!

To integrate your AI chatbot (built using Dialogflow) into your mobile app, you need to interact with the Dialogflow API, which allows your app to send user queries and receive responses from the agent. 

Here are general steps that might help you integrate your Dialogflow agent into a mobile app:

  1. Create and Configure a Service Account - ensure that your Dialogflow agent is connected to your Google Cloud project. You need to create a service account to authenticate API requests.
  2. Set Up Authentication on the Mobile App - For security reasons, it's recommended that you don't directly include the service account key in your mobile app. Instead, use a secure method for authentication, such as OAuth2.
  3. Dialogflow API Client Libraries - Google offers client libraries in multiple languages, including Android and iOS. These libraries handle most of the complexities of authentication and communication with Dialogflow.
  4.  Sending Requests to Dialogflow - To send a message from your mobile app to your Dialogflow agent, you would send a POST request to the Dialogflow API endpoint, passing the query and other parameters in the request body. 
  5. Handle Responses -The response from the Dialogflow API will contain a queryResult object, which includes the response text from the agent, intents, and other information. You can parse the response JSON and display the appropriate information in your app's UI.

I hope the above information is helpful.