# Generative AI code samples and sample applications

## Sample applications

Deploy a prebuilt generative AI sample application, then fork the code to modify it for your own use-case.


### [Generate a marketing campaign with Gemini](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/gemini-streamlit-cloudrun)

Build a web app to generate marketing campaign ideas, using Gemini on Vertex AI, Cloud Run, and [Streamlit](https://streamlit.io/).


Beginner

Python

### [Airport Assistant: RAG App](https://github.com/GoogleCloudPlatform/genai-databases-retrieval-app)

Sample app for retrieval-augmented generation with AlloyDB for PostgreSQL and Vertex AI. ([blog post](https://cloud.google.com/blog/products/databases/introducing-sample-genai-databases-retrieval-app), [codelab](https://codelabs.developers.google.com/codelabs/genai-db-retrieval-app)).


Intermediate

Python

### [GenWealth: RAG app](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Learn to build a Node-based RAG app that provides investment recommendations for financial advisors. This sample integrates with Vertex AI, Cloud Run, AlloyDB, and Cloud Run functions. Built with Angular, TypeScript, Express.js, and LangChain.


Intermediate

Node

### [Fix My Car: RAG app](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/fixmycar)

Learn to build a RAG app that helps car owners troubleshoot their vehicle, without having to flip through their owner's manual. Variants include Cloud SQL with pgvector, and Agent Search. Built with Java (Spring) and Python (Streamlit).


Intermediate

Java

### [Deploy Llama models on Cloud Run](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/llamadeploy-on-cloud-run)

Learn how to deploy and run Meta's Llama models on Cloud Run.


Beginner

Python

## SDKs and Frameworks

Learn how to work with Google Cloud's generative AI APIs using SDK code snippets.


### [Vertex AI - Gemini SDKs](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Learn how to apply the Vertex AI Gemini SDKs to tasks like chat, multimodal prompts, and document processing. [Browse additional code samples here.](https://docs.cloud.google.com/vertex-ai/docs/samples.md.txt?text=gemini)


Beginner

Python

Node

Java

Go

C#

### [Agent Search SDKs](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Learn how to store and retrieve RAG documents using Agent Search.


Beginner

Python

Node

Java

Go

C#

PHP

Ruby

### [Browse all Google Cloud client libraries](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Integrating other products, like Cloud Storage or Firestore, into your generative AI app? Browse all Google Cloudclient libraries in your programming language of choice.


Beginner

Python

Node

Java

Go

C#

PHP

Ruby

### [LangChain (Python)](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI), vector databases (AlloyDB, Cloud SQL, Firestore, Agent Search, BigQuery, and others), and others (Google Drive, Google Maps, YouTube, and others).


Beginner

Python

### [LangChain.js (Node)](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/sample-apps/genwealth)

Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI), vector databases (Vertex AI Vector Search), and others (Google Search).


Beginner

Node

### [Genkit (Node)](https://genkit.dev)

Genkit is an open-source framework that helps you build, deploy, and monitor production-ready AI-powered web applications. Genkit comes with plugins for [Vertex AI](https://genkit.dev/docs/integrations/vertex-ai/), [Cloud Operations](https://genkit.dev/docs/integrations/google-cloud/?lang=go), and [Firestore](https://genkit.dev/docs/deployment/firebase/?lang=js).


Beginner

Node

### [LangChain4j (Java)](https://docs.langchain4j.dev/integrations/language-models/google-gemini)

Explore code snippets for using LangChain alongside Google Cloud products, including chat models (Vertex AI).


Beginner

Java

## Notebooks

Explore interactive walkthroughs of generative AI use cases.


### [Getting started with Vertex AI Gemini 1.5 Flash](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/getting-started/intro_gemini_1_5_flash.ipynb)

Learn how to call Gemini 1.5 Flash, and leverage its long context window, using the Vertex AI SDK. This notebook includes text, video, and audio modalities.


Beginner

Python

### [Sheet Music Analysis with Gemini](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/use-cases/document-processing/sheet_music.ipynb)

Learn how to extract sheet music metadata, such as composer and tempo, from PDFs using the Vertex AI SDK.


Beginner

Python

### [YouTube Video Analysis with Gemini](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/use-cases/video-analysis/video_analysis.ipynb)

Learn how to do direct analysis of publicly available YouTube videos with Gemini.


Beginner

Python

### [Analyzing movie posters in BigQuery with Gemini](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/use-cases/applying-llms-to-data/analyze-poster-images-in-bigquery/poster_image_analysis.ipynb)

Learn how to extract information from movie posters by calling Gemini directly from BigQuery.


Intermediate

Python

### [Introduction to Vertex AI Embeddings - Text \& Multimodal](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/qa-ops/intro_Vertex_AI_embeddings.ipynb)

Learn how to convert text and images to vector embeddings using the Vertex AI SDK, for use in a retrieval-augmented generation (RAG) application.


Intermediate

Python

### [Function-calling with Gemini](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/function-calling/use_case_company_news_and_insights.ipynb)

Learn how to augment Gemini's response with real-time data, such as a company's stock price and latest news.


Intermediate

Python

### [Code migration from PaLM to Gemini](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/migration/PaLM_to_gemini_codemigration.ipynb)

Learn how to migrate your existing Vertex AI SDK code to call Gemini instead of PaLM.


Intermediate

Python

### [Supervised Tuning with Gemini for Question-answering](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/migration/PaLM_to_gemini_codemigration.ipynb)

Learn how to tune Gemini using Vertex AI, to train the model to respond well to questions about Python coding.


Advanced

Python

### [Browse all notebooks](https://cloud.google.com/vertex-ai/generative-ai/docs/samples?doctype=notebook)

Explore dozens of other Vertex AI notebooks in the Google Cloud Sample Browser.


Intermediate

Python

## Learn more

- [All Vertex AI code samples](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/samples.md.txt)
- [Google Cloud sample browser](https://docs.cloud.google.com/docs/samples.md.txt)