Skip to content

shrawank039/sql-talk-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Talk: Natural Language to BigQuery with Gemini's Function Calling

Overview

This app demonstrates the power of Gemini's Function Calling capabilities, enabling users to query and understand their BigQuery databases using natural language. Forget complex SQL syntax – interact with your data conversationally.

Function Calling in Gemini lets developers create a description of a function in their code, then pass that description to a language model in a request. The response from the model includes the name of a function that matches the description and the arguments to call it with.

SQL Talk Demo App

Prerequisites

  • A Google Cloud project with billing enabled
  • A BigQuery dataset (we used the thelook_ecommerce public dataset)
  • APIs for Vertex AI, BigQuery, and Cloud Run enabled
  • Familiarity with Python and SQL concepts

Run and modify the app in Cloud Shell Editor

After you've tried out the live demo app, you can also 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.

Open this repository and the sample app in the Cloud Shell Editor, then follow the steps displayed in the tutorial in the sidebar.

Additional resources

You can learn more about Function Calling in Gemini with these guides and resources:

(Optional) Deploy the app to Cloud Run

When deploying this app to Cloud Run, a best practice is to create a service account to attach the following roles to, which are the permissions required for the app to read data from BigQuery, run BigQuery jobs, and use resources in Vertex AI:

To deploy this app to Cloud Run, run the following command to have the app built with Cloud Build and deployed to Cloud Run, replacing the service-account and project values with your own values, similar to:

gcloud run deploy sql-talk --allow-unauthenticated --region us-central1 --service-account SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com --source .

Congratulations, you've successfully deployed the SQL Talk demo app!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published