LangChain with Google Cloud
To get started, you need to have a Google Cloud project with billing and enable the Vertex AI API on it. If you are new to Google Cloud or you’re unfamiliar with some of the Google Cloud services that we mention during this section, take a look at Chapter 4.
You must authenticate yourself on Google Cloud. Most probably, you’ll be trying things out with a Jupyter notebook (and we’ll look into deploying your application to production in Chapter 16). In that case, you have a few options:
- If you’re running a Jupyter notebook locally, you can use your local credentials. All you need to do is run the following in the terminal:
gcloud auth application-default login
- If you’re running a Colab notebook, you can authenticate with your own credentials (but you’ll need to refresh them each time after your instance is stopped):
from google.colab import auth auth.authenticate_user()
If you’re using a Jupyter...