Skip to content

Latest commit

 

History

History
 
 

genai-gradio-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
Copyright 2023 Google. This software is provided as-is, without warranty or
representation for any use or purpose. Your use of it is subject to your
agreement with Google.

Technology Stack

  • Google Cloud Run
  • Google Artifact Registry
  • Google Cloud Storage
  • Google Speech to Text
  • Vertex AI Conversation
  • Dialogflow CX
  • Dialogflow CX Agent
  • Google Data Store
  • Google Secret Manager
  • Gradio

GCP Project Setup

Creating a Project in the Google Cloud Platform Console

If you haven't already created a project, create one now. Projects enable you to manage all Google Cloud Platform resources for your app, including deployment, access control, billing, and services.

  1. Open the Cloud Platform Console.
  2. In the drop-down menu at the top, select NEW PROJECT.
  3. Give your project a name.
  4. Make a note of the project ID, which might be different from the project name. The project ID is used in commands and in configurations.

Enabling billing for your project.

If you haven't already enabled billing for your project, enable billing now. Enabling billing allows is required to use Cloud Bigtable and to create VM instances.

Install the Google Cloud SDK.

If you haven't already installed the Google Cloud SDK, install the Google Cloud SDK now. The SDK contains tools and libraries that enable you to create and manage resources on Google Cloud Platform.

Setting Google Application Default Credentials

Set your Google Application Default Credentials by initializing the Google Cloud SDK with the command:

   gcloud init

Generate a credentials file by running the application-default login command:

    gcloud auth application-default login

Upload your data to a Cloud Storage bucket

Follow these instructions to upload your pdf documents or pdf manuals to be used in this example

Create a Generative AI Agent

Follow the instructions at this link and perform the following:

  1. Create Data Stores: Select information that you would like the Vertex AI Search and Conversation to query
  2. Create an Agent: Create the Dialogflow CX agent that queries the Data Store
  3. Test the agent in the simulator
  4. Take note of you agent link by going to Dialogflow CX Console and see the information about the agent you created

Dialogflow CX Agent Data Stores

Data Stores are used to find answers for end-user's questions. Data Stores are a collection documents, each of which reference your data.

For this particular example data store will consist of the following characteristics:

  1. Your organizational documents or manuals.
  2. The data store type will be unstructured in a pdf format
  3. The data is uploaded without metadata for simplicity. Only need to point the import to the gcp bucket folder where the pdf files are. Their extension will decide their type.

When an end-user asks the agent a question, the agent searches for an answer from the given source content and summarizes the findings into a coherent agent response. It also provides supporting links to the sources of the response for the end-user to learn more.