# 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
13 Part 4 Hackathon
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:
Create an embedded product catalog and a chat system to query it
Load various mixed data sources and create a chat application that helps categorize the data
Create a chat application verification, prompt injection defense, quality evaluation
This notebook should help you get started.
# Automatically restart kernel after installs so that your environment can access the new packages
import IPython
= IPython.Application.instance()
app True) app.kernel.do_shutdown(
from google.colab import auth
auth.authenticate_user()
# Add your project id and region
= "<...>"
PROJECT_ID = "<...>" REGION
import vertexai
=PROJECT_ID, location=REGION) vertexai.init(project
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