13  Part 4 Hackathon

Open In Colab

Let’s get imaginative and use the skills we have learned over the past two days to implement a proof-of-concept. Here are some ideas:

This notebook should help you get started.

# Install the packages
! pip install --upgrade google-cloud-aiplatform
! pip install shapely<2.0.0
! pip install langchain
! pip install pypdf
! pip install pydantic==1.10.8
! pip install chromadb==0.3.26
! pip install langchain[docarray]
! pip install typing-inspect==0.8.0 typing_extensions==4.5.0
# Automatically restart kernel after installs so that your environment can access the new packages
import IPython

app = IPython.Application.instance()
app.kernel.do_shutdown(True)
from google.colab import auth
auth.authenticate_user()
# Add your project id and region
PROJECT_ID = "<...>"
REGION = "<...>"
import vertexai
vertexai.init(project=PROJECT_ID, location=REGION)

Your awesome POC follows!

# Some imports you may need

# Utils
import time
from typing import List

# Langchain
import langchain
from pydantic import BaseModel

print(f"LangChain version: {langchain.__version__}")

# Vertex AI
from langchain.chat_models import ChatVertexAI
from langchain.embeddings import VertexAIEmbeddings
from langchain.llms import VertexAI
from langchain.schema import HumanMessage, SystemMessage