[go: nahoru, domu]

Skip to content

Latest commit

 

History

History
122 lines (80 loc) · 3.38 KB

File metadata and controls

122 lines (80 loc) · 3.38 KB

Welcome to the SQL Talk app tutorial

Overview

This app demonstrates the power of Gemini's function calling capabilities, enabling users to query and understand their BigQuery databases using natural language.

Tutorial

You can follow the steps in this tutorial to run your own version of the SQL Talk app and make changes to the live app using the Cloud Shell Editor in your own Google Cloud project.

Ready?

Let's get started!

Configuration

Configure your project

To configure your Google Cloud project to use with this sample app, run the following command and replace YOUR_PROJECT_ID with your own Google Cloud project ID.:

gcloud config set project YOUR_PROJECT_ID

You can locate your project ID by visiting the Dashboard in the Google Cloud Console.

Setup

Running the app

To set up your Cloud Shell environment and start the sample app, run the following command:

bash setup.sh

This script will:

  • Enable the Vertex AI and BigQuery APIs
  • Install Python and packages
  • Start the SQL Talk app

App is ready

Once the app is running, you'll see output in the terminal window similar to the following:

You can now view your Streamlit app in your browser.

Network URL: http://10.88.0.3:8080
External URL: http://34.69.5.212:8080

Access the app

In the Cloud Shell Editor toolbar, click the Web Preview icon, then select the option to Preview on port 8080. You should see a running version of the app and interact with it as usual.

Modify the app

Testing changes

Now that you have the app running, let's make a simple change to the app such as changing the app title from:

st.title("SQL Talk with BigQuery")

to:

st.title("Hello from SQL Talk with BigQuery")

Then refresh the web app, and you should see the new title displayed.

Extending the app

Consider adding and modifying the available functions to perform:

  • Data visualization: Create charts/graphs to summarize the findings
  • Other database integrations: Support for PostgreSQL, MySQL, etc.
  • APIs: Connect to weather APIs, translation services, and more.

Conclusion

Congratulations! You've successfully ran and edited the SQL Talk app.

Cleaning up

You can perform the following cleanup to avoid incurring charges to your Google Cloud account for the resources used in this tutorial:

To avoid unnecessary Google Cloud charges, use the Google Cloud console to delete your project if you do not need it.

Additional resources

You can learn more about function calling in Gemini with these guides and resources: