Going hands-on with Gemini 2.0 Flash and Google Unified SDK
Singapore
Let’s Get Started!
Before Workshop - Setting up
Build
with AI
Setting up
1. Go to trygcp.dev/e/bwai-sg-mar22
Setting up
2. Sign in
(with the right Google Account)
trygcp.dev/e/bwai-sg-mar22
Setting up
3. Validate Details
Correct Google Account?
(Don’t redeem to company or inactive email account!)
Email address double check
Don’t share!
trygcp.dev/e/bwai-sg-mar22
Setting up
4. Accept and continue
(If you accept terms and conditions 😬)
trygcp.dev/e/bwai-sg-mar22
Setting up
5. Go to console.cloud.google.com/billing
trygcp.dev/e/bwai-sg-mar22
Setting up
6. Check for the Google Cloud Platform Trial Billing Account
trygcp.dev/e/bwai-sg-mar22
Setting up
7. Go to console.cloud.google.com/projectcreate
trygcp.dev/e/bwai-sg-mar22
Setting up
8. Create new project, with billing account as “Google Cloud Platform Trial Billing Account”
trygcp.dev/e/bwai-sg-mar22
Setting up
In case you cannot select a billing account earlier
Check console.cloud.google.com/billing/projects and make sure your project is tied to the right project
Setting up
9. To to the home page console.cloud.google.com , and search for “Vertex AI API”
10. Double check if right project, and then click “ENABLE”
Workshop Part 0 - TL;DR
Build
with AI
Learning outcomes
Workshop
Tip #1 - “Shift”+”Enter” to progress through the cells in Colab / Jupyter Notebook
Workshop
Tip #2 - Opps I accidentally clicked a markdown cell? “Ctrl”+”Enter” to restore!
Workshop
Workshop
(If you want to self-run) Scan the following QR code
�
I’ll also be running through this slidedeck and explaining along the way, so follow along my pace if you want an in-depth learning experience.
Workshop 1 - Intro to Gemini 2.0 Flash
Build
with AI
Accessing Workshop 1 - “Intro to Gemini 2.0 Flash”
Workshop
1. Go to URL: bit.ly/bwai-gemini-2-intro-lab
2. Select “Open in Colab”
3. Select “Copy to Drive”
Get your Project Id from “console.cloud.google.com”
Workshop
What the “async” (and coroutines)?
Workshop
https://www.jetify.com/blog/python-coroutines-and-the-cloud/
https://docs.python.org/3/library/asyncio-task.html#coroutine
Testing parameters like temperature - can use Google AI Studio
Workshop
https://aistudio.google.com/
Threshold values enum values
Workshop
https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.types.SafetySetting.HarmBlockThreshold
Name | Description |
HARM_BLOCK_THRESHOLD_UNSPECIFIED | Unspecified harm block threshold. |
BLOCK_LOW_AND_ABOVE | Block low threshold and above (i.e. block more). |
BLOCK_MEDIUM_AND_ABOVE | Block medium threshold and above. |
BLOCK_ONLY_HIGH | Block only high threshold (i.e. block less). |
BLOCK_NONE | Block none. |
OFF | Turn off the safety filter. |
Function Calling
Workshop
https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling
Code Execution
Workshop
https://ai.google.dev/gemini-api/docs/code-execution
https://github.com/googleapis/python-genai/blob/fe444a5a06b747df06ab94846eed19f784fb4584/google/genai/types.py
(Self-drive) Workshop 2 - Getting started with Google Generative AI using the Gen AI SDK
Build
with AI
Accessing Workshop 2 - “Getting started … using the Gen AI SDK”
Workshop
1. Go to URL: bit.ly/bwai-gemini-2-sdk-lab
2. Select “Open in Colab”
3. Select “Copy to Drive”
Get your Project Id from “console.cloud.google.com”
Workshop
Skip to “Use context caching”
Workshop
Context caching files
Workshop
Batch requests file
Workshop
Build
with AI
Thank you!
Resources
Liu Weiyuan
big-on.dev/-/weiyuan
bit.ly/weiyuan-linkedin