Welcome, this is a workshop using Google's Gemini LLM to build an e-commerce product description generator (for the Build With AI event series).
Gemini LLM
Gemini is a family of multimodal large language models developed by Google DeepMind. Unlike other LLMs, Gemini was said to be unique in that it was not trained on a text corpus alone and was designed to be multimodal, meaning it could process multiple types of data simultaneously, including text, images, audio, video, and computer code. - Source
Vertex AI
Vertex AI is a fully-managed, unified AI development platform for building and using generative AI. Access and utilize AI Studio, Agent Builder, and 130+ foundation models including Gemini 1.5 Pro—all from Vertex AI. - Source
E-commerce product description generator
The goal of this workshop is to build an E-commerce product description generator that focuses on fashion e-commerce products. The usual process for many products that are published on an e-commerce website is, that photos are taken for each product in a studio generally with a model wearing it.
With the photos of the product (with or without a model) and the product's description which includes brand, material, wash instructions, etc a copywriter writes a description for each product. Then it goes through a copy edit process and finally, when the product is published on the website the product description is also included in it. Below is a sample product description of women's Jeans by Guess (possibly written by a human):
This workshop is about automating the process, where the copywriter (or someone else), will upload the photos and ask Gemini to generate a product description. The photos used in this workshop are right free images by Dmitriy Steinke from Pexels.
To begin, you will need to have the following pre-requisites sorted:
Please be aware of the Vertex AI Pricing as well.
gemini-ecomm
or anything relevant as seen below:vertex
on the search bar as seen below:Vertex AI
Freeform
found on the left menugemini-1.0-pro-vision-001
model selected. Then, paste the following prompt in the Prompt
text box:As an expert e-commerce copywriter, analyze the uploaded images of
women's jeans and write a product description for a low to mid-end
fashion e-commerce website. Please include the details about the
comfortable to wear jeans and do not include any details about the
price. Make sure that the copy is written in an engaging and friendly tone.
images.zip
file. Navigate to womens-jeans-photos
folder after clicking the Insert Media
option on the middle of the Prompt
textbox. Then click Upload
and upload all Once all the 8 images, it will look something like the below:>
button to submit and test out the prompt with the uploaded images, you should get a response similar to the following:pen
icon beside Untitled prompt
above the prompt text box, then type e-commerce-product-desc-generator
the click anywhere, it will look like the below while editing:Save
on the top left part of the right sidebar as shown below:All saved prompts will be accessible in your Prompt management page. You can access it from the Prompt management
link on the left sidebar.
Prompt Name
if you are on the Prompt management
page.Below is a configuration you can try out, the right settings for this configuration depend on how you want the output to be shaped by Gemini:
Safety Settings
correctly as per your use case, for now, we will set it at maximum safety (Responsible AI). As seen below, the safety settings (found on the right sidebar are self-explanatory)As an expert e-commerce copywriter, analyze the uploaded images of women's
jeans and write a product description for a low to mid-end fashion e-commerce
website. Please include the details about the comfortable to wear clothing and
do not include any details about the price. Make sure that the copy is written
in an engaging and direct tone.
You can play around with the prompt and make it more flexible or more specific as per your goals.
The optional code step is next.
<> Get Code
link which shows a slider on the right side as follows:For this workshop, you will use the Node.js code and try it out. For that you will use Cloud shell and Cloud shell editor.
Activate Cloud Shell
toward the top right corner of the screen as seen below:Open Editor
:Hamburger Menu > Terminal > New Terminal
as follow:mkdir projects && cd projects && mkdir gemini-workshop && cd gemini-workshop
and then pip3 install --upgrade google-cloud-aiplatform
:Hamburger Menu > File > Open Folder
:projects/gem
and select the gemini-workshop
option and click OK
:file+
icon besides GEMINI-WORKSHOP
and name it gemini.py
<>GET CODE
on the Vertex AI Editor screen, while on the Python
option copy the code into a file called gemini.py
gemini.py
empty file and save it:Hamburger Menu > Terminal > New Terminal
and type in python gemini.py
then hit enter. It will ask you to Authorise
:After authorisation the code will run and give an outupt like the below:
Congrats! You are a Gemini and Vertex AI novice now :). You can close the Cloud Shell Editor. Even shutdown/delete the project if you like.
The generated code is more like a proof of concept. You can add an API layer and UI on top of it to make it more useful. You can deploy that API on Google Cloud Run as serverelss containers.
For instance below is a basic UI generated with v0 with the prompt:
An internal tool for e-commerce websites to generate product descriptions,
it will have a product name text box, multi-file upload field, category
select box with clothes, shoes, accessory options, gender select box
with male, female, and unisex options and age select box with infants,
kids, teens, and adults options. Then a button that says Generate.
The UI is below:
Go back to the slides :).