1 of 85

Beyond Chat:

Exploring the Power of Gemini

Tanitphon Paniwan (Mike)

CTO @ Apppi

2 of 85

  • Tanitphon Paniwan (Mike)
  • CTO at Apppi
  • Content Creator at Mikelopster
  • Web specialist

Hello Iā€™m Mike

Speaker

3 of 85

4 of 85

Chat to start writing, planning, learning and more with Google AI

Supercharge your creativity and productivity

5 of 85

6 of 85

More than AI Chat

7 of 85

Chat

API

RAG

8 of 85

9 of 85

Jeff

Kind PM

Johnson

Lovely Web Dev

10 of 85

Gemini (Advanced and Assist)

Making a website is easy

Chat

11 of 85

Jeff / Kind PM

Hi there, I'd like you to create a simple website for us to sell our products. We already have all the information ready for you. You can start building the website now.

Johnson / Lovely Dev

OK !

12 of 85

13 of 85

Recommended šŸ‘

14 of 85

Frontend

Home Page

Product Service

Backend

products.json

GET /api/products

use

Mock

15 of 85

Jeff / Kind PM

I forgot to mention, we don't have any systems to connect to and the data is in CSV format. Is that okay with you ?

Johnson / Lovely Dev

Umā€¦ OK !

16 of 85

id,name,price,image,link

1,Product A,29.99,https://fastly.picsum.photos/id/1

2,Product B,45.5,https://fastly.picsum.photos/id/2

3,Product C,19.95,https://fastly.picsum.photos/id/3

[

{

"id": 1,

"name": "Product A",

"price": 29.99,

"image": "https://fastly.picsum.photos/id/1",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "A high-quality product designed for everyday use."

},

{

"id": 2,

"name": "Product B",

"price": 45.5,

"image": "https://fastly.picsum.photos/id/2",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "Experience the premium quality of Product B."

},

{

"id": 3,

"name": "Product C",

"price": 19.95,

"image": "https://fastly.picsum.photos/id/3I",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "Product C offers exceptional value and performance."

}

]

???

CSV

JSON

Oh my God

17 of 85

id,name,price,image,link

1,Product A,29.99,https://fastly.picsum.photos/id/1

2,Product B,45.5,https://fastly.picsum.photos/id/2

3,Product C,19.95,https://fastly.picsum.photos/id/3

[

{

"id": 1,

"name": "Product A",

"price": 29.99,

"image": "https://fastly.picsum.photos/id/1",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "A high-quality product designed for everyday use."

},

{

"id": 2,

"name": "Product B",

"price": 45.5,

"image": "https://fastly.picsum.photos/id/2",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "Experience the premium quality of Product B."

},

{

"id": 3,

"name": "Product C",

"price": 19.95,

"image": "https://fastly.picsum.photos/id/3I",

"link": "https://nextjs.org/docs/app/building-your-application/routing/route-handlers",

"description": "Product C offers exceptional value and performance."

}

]

CSV

JSON

Solution #1

Data Conversion

18 of 85

products.json

products.csv

Frontend

Home Page

Product Service

Backend

GET /api/products

use

19 of 85

products.json

products.csv

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Who ???

20 of 85

products.json

products.csv

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Oh my God #2

21 of 85

Jeff / Kind PM

That's fine, but our data is updated daily. Can you handle that ?

Johnson / Lovely Dev

Or should I create an upload page for the admin to upload the data instead ?

22 of 85

Code Generation

Frequently used šŸ‘

23 of 85

1

24 of 85

2

25 of 85

2

26 of 85

2

27 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Solution #2

Code Generation

28 of 85

  • Data Conversion
  • Code Generation
  • Code Completion
  • Documentation generation
  • Testing assistance

Gemini

Chat

29 of 85

https://inthecloud.withgoogle.com/gemini-for-google-workspace-prompt-guide/dl-cd.html

30 of 85

Gemini API

Features that shouldn't be called features

API

31 of 85

Jeff / Kind PM

Hey, I'd like you to add a description section and write product descriptions for the website.

Johnson / Lovely Dev

(Don't you think this is a bit strange?)

Umā€¦ Let me try

32 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Oh my God #3

Who ???

33 of 85

34 of 85

https://ai.google.dev/

35 of 85

Explore prompt ideas for the Gemini API in Google AI Studio. Code examples and more on the Gemini API cookbook.

Prompt gallery

36 of 85

37 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Solution #3

Gemini API

gen & write

Send prompt

+

products.json

38 of 85

Gemini API

39 of 85

ā€œPromptā€

40 of 85

Mike

Clear prompts, Powerful AI

A little-known developer

41 of 85

Tell me what kind of prompt you want

The best prompt ever

šŸ¤©

šŸ˜«

42 of 85

Letā€™s try

43 of 85

Jeff / Kind PM

You can do it ! Since you're at it, make the website multilingual too.

Johnson / Lovely Dev

(ćˆć£ć€ä½•ć“ć‚Œ ?)

It's quite a challenge, but I'll give it a try.

44 of 85

Solution #3

Instruction-Based Prompting

45 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Solution #3

Gemini API

gen & write

Send prompt

+

products.json

46 of 85

Solution #3

Instruction-Based Prompting

47 of 85

48 of 85

https://www.promptingguide.ai/

49 of 85

https://github.com/google-gemini/cookbook

50 of 85

  • Integration into Existing Applications
  • Automated workflows
  • Content Generation

Gemini API

API

API

51 of 85

Gemini API + RAG

Web Developer who goes above and beyond

RAG

52 of 85

Jeff / Kind PM

I think our website should have a search engine. It would make it easier for customers to find product information.

Johnson / Lovely Dev

Okay, so we're adding a search feature? Not difficult, we can just match the search terms against the product names and descriptions.

53 of 85

Jeff / Kind PM

I don't think you understand search engines. It's not just about matching keywords. It needs to be able to search based on any words the customer feels are relevant.

Johnson / Lovely Dev

(Should we hire a Data Scientist to help with this?)

It's quite difficult for me, but I'll give it a try.

54 of 85

AI Hallucination

1

55 of 85

56 of 85

ā€œThe power of connected knowledgeā€

šŸ§ šŸ”— šŸŒšŸ’”šŸ’Ŗ

57 of 85

2

58 of 85

Ref: https://www.researchgate.net/figure/A-comparative-view-of-AI-machine-learning-deep-learning-and-generative-AI-source_fig1_373797588

59 of 85

RAG

60 of 85

Retrieval-Augmented Generation

61 of 85

Ref: https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/

62 of 85

1

+ =

2

šŸ˜«

AI Hallucination

Knowledge ML

63 of 85

Vertex AI = šŸ‘

64 of 85

Vertex AI is a machine learning (ML) platform that lets you train and deploy ML models and AI applications, and customize large language models (LLMs) for use in your AI-powered applications. Vertex AI combines data engineering, data science, and ML engineering workflows, enabling your teams to collaborate using a common toolset and scale your applications using the benefits of Google Cloud.

64

Vertex AI

Machine Learning

65 of 85

Generative AI

66 of 85

67 of 85

68 of 85

https://cloud.google.com/vertex-ai/generative-ai/docs/llamaindex-on-vertexai

69 of 85

Create RAG Corpus

Import file to Corpus

Create RAG Retrieval Tool

+

Model instance

Modify Prompt Template

Generate response from Gemini + RAG

RAG

LLM

70 of 85

Create RAG Corpus

1

71 of 85

Import file to Corpus

2

Note

  • chunk_size helps with efficient processing and retrieval. Smaller chunks allow for faster searches and more precise results.
  • chunk_overlap are useful for capturing context that might be split between chunks. This is particularly helpful when dealing with sentences or phrases that could be cut off in the middle.

72 of 85

Create RAG Retrieval Tool

3

Model instance

Model instance

73 of 85

4

Modify Prompt Template

74 of 85

5

Generate response from Gemini + RAG

4

3

Modify Prompt Template

Create RAG Retrieval Tool

+

Model instance

75 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Gemini API

gen & write

Send prompt

+

products.json

Oh my God #4

Where ??

76 of 85

Node.js can run Python processes

77 of 85

search.js

search.py

(Vertex AI)

products.json

šŸ‘

78 of 85

products.json

Frontend

Home Page

Product Service

Backend

GET /api/products

use

Upload Page

Upload Service

POST /api/upload

products.csv

upload

convert & write

Gemini API

gen & write

Send prompt

+

products.json

Solution #4

Search Service

GET /api/products/search

search.py

(Vertex AI)

products.json

Upload

79 of 85

  • Integration into Existing Applications
  • Fact-checking
  • Personalized recommendations

Gemini API + RAG

RAG

80 of 85

Code + Document Generation / Assistance

āœ…

āœ…

āœ…

Data Conversion / Data Analysis

āœ…

āœ…

āœ…

Integration into Existing Applications

(Suggestion / Chatbot)

ā›”ļø

āœ…

āœ…

Automated workflows (Auto Conversion / Translation)

ā›”ļø

āœ…

āœ…

Large-Scale Content Generation

ā›”ļø

āœ…

āœ…

Fact-checking / Knowledge-based question

āš ļø

āš ļø

āœ…

Personalized recommendations

ā›”ļø

ā›”ļø

āœ…

Chat

RAG

API

Which One to Use When?

Information at 21/06

81 of 85

Jeff / Kind PM

Thank you so much, Johnson. You're a godsend to our company.

Johnson / Lovely Dev

With love and appreciation, Dear Boss

82 of 85

83 of 85

Chat

API

RAG

84 of 85

See more at Mikelopster

85 of 85

Thank You

Tanitphon Paniwan (Mike)

CTO @ Apppi