Technical requirements
This chapter will use LangChain and Vertex AI. You can choose any Jupyter Notebook for prototyping: A locally hosted one, Google Colab, or one of the notebook solutions provided by Google Cloud (Colab Enterprise or Vertex AI Workbench). Install the following libraries in your Python environment:
pip install --upgrade langchain-google-vertexai
This command will also install the Vertex AI software development kit (SDK), Python library to prepare and send requests to Google Cloud Vertex AI APIs. If you’re using a Jupyter Notebook (local or a cloud-hosted version), you will need to restart your Python environment after the SDK is installed:
import IPython app = IPython.Application.instance() app.kernel.do_shutdown(True)
You need to have Vertex AI API enabled in your Google Cloud project and have a Vertex AI User role. If you have authentication issues, see Chapter 1 for additional guidance.