# Install the packages
! pip3 install --upgrade google-cloud-aiplatform
! pip3 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
12 Part 3 Exercise
We’ll now practice what we have learned today. Try the following:
Get some data (your own data, something interesting online, or use the LLM to create some!)
Create embeddings for the data, either using Chroma or Matching Engine.
Create prompts that allow a user to interact with the data and perform common tasks (question and answering, retrieval, summarization etc).
Bonus: try it with LangChain!
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
12.0.1 TODO:
Get some data (your own data, something interesting online, or use the LLM to create some!)
# Your code here
12.0.2 TODO:
Create embeddings for the data, either using Chroma (quicker) or Matching Engine.
# Your code here
12.0.3 TODO:
Create prompts that allow a user to interact with the data and perform common tasks (question and answering, retrieval, summarization etc).
# Your code here
12.0.4 TODO:
Write evaluation prompts and contexts to check the quality of outputs.
# Your code here