|
1 | 1 | # Generative AI Samples on Google Cloud
|
2 | 2 |
|
3 |
| -Welcome to the Python samples folder for Generative AI on Vertex AI! In this folder, you can find the Python samples |
4 |
| -used in [Google Cloud Generative AI documentation](https://cloud.google.com/ai/generative-ai?hl=en). |
5 |
| - |
6 |
| -If you are looking for colab notebook, then please check https://github.com/GoogleCloudPlatform/generative-ai. |
| 3 | +This directory contains Python code samples demonstrating how to use Google Cloud's Generative AI capabilities on Vertex AI. These samples accompany the [Google Cloud Generative AI documentation](https://cloud.google.com/ai/generative-ai) and provide practical examples of various features and use cases. |
7 | 4 |
|
8 | 5 | ## Getting Started
|
9 | 6 |
|
10 |
| -To try and run these Code samples, we recommend using Google Cloud IDE or Google Colab. |
| 7 | +To run these samples, we recommend using either Google Cloud Shell, Cloud Code IDE, or Google Colab. You'll need a Google Cloud Project and appropriate credentials. |
| 8 | + |
| 9 | +**Prerequisites:** |
| 10 | + |
| 11 | +- **Google Cloud Project:** Create or select a project in the [Google Cloud Console](https://console.cloud.google.com). |
| 12 | +- **Authentication:** Ensure you've authenticated with your Google Cloud account. See the [authentication documentation](https://cloud.google.com/docs/authentication) for details. |
| 13 | +- **Enable the Vertex AI API:** Enable the API in your project through the [Cloud Console](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com). |
| 14 | + |
| 15 | +## Sample Categories |
| 16 | + |
| 17 | +The samples are organized into the following categories: |
| 18 | + |
| 19 | +### Batch Prediction (`batch_prediction`) |
| 20 | + |
| 21 | +Demonstrates how to use batch prediction with Generative AI models. This allows efficient processing of large datasets. See the [Batch Prediction documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/batch-prediction-gemini) for more details. |
| 22 | + |
| 23 | +### Content Cache (`content_cache`) |
| 24 | + |
| 25 | +Illustrates how to create, update, use, and delete content caches. Caches store frequently used content to improve performance and reduce costs. See the [Content Cache documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview) for more information. |
| 26 | + |
| 27 | +### Controlled Generation (`controlled_generation`) |
| 28 | + |
| 29 | +Provides examples of how to control various aspects of the generated content, such as length, format, safety attributes, and more. This allows for tailoring the output to specific requirements and constraints. See the [Controlled Generation documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output) for details. |
| 30 | + |
| 31 | +### Count Tokens (`count_tokens`) |
| 32 | + |
| 33 | +Shows how to estimate token usage for inputs and outputs of Generative AI models. Understanding token consumption is crucial for managing costs and optimizing performance. See the [Token Counting documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/list-token) for more details. |
| 34 | + |
| 35 | +### Express Mode (`express_mode`) |
| 36 | + |
| 37 | +Demonstrates how to use Express Mode for simpler and faster interactions with Generative AI models using an API key. This mode is ideal for quick prototyping and experimentation. See the [Express Mode documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/start/express-mode/overview) for details. |
| 38 | + |
| 39 | +### Live API (`live_api`) |
| 40 | + |
| 41 | +Provides examples of using the Generative AI [Live API](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal-live-api). This allows for real-time interactions and dynamic content generation. |
| 42 | + |
| 43 | +### Safety (`safety`) |
11 | 44 |
|
12 |
| -Note: A Google Cloud Project is a pre-requisite. |
| 45 | +Provides examples demonstrating how to configure and apply safety settings to Generative AI models. This includes techniques for content filtering and moderation to ensure responsible AI usage. See the [Safety documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-attributes) for details. |
13 | 46 |
|
14 |
| -## Features folders |
| 47 | +### Text Generation (`text_generation`) |
15 | 48 |
|
16 |
| -All GenAI code samples are organised into folders, referred as Feature folders. |
| 49 | +Provides examples of generating text using various input modalities (text, images, audio, video) and features like asynchronous generation, chat, and text streaming. See the [Text Generation documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/send-chat-prompts-gemini) for details. |
17 | 50 |
|
18 |
| -### Features |
| 51 | +### Tools (`tools`) |
19 | 52 |
|
20 |
| -<table> |
21 |
| - <tr> |
22 |
| - <td><strong>Python Samples Folder</strong> |
23 |
| - </td> |
24 |
| - <td><strong>Google Cloud Product</strong> |
25 |
| - </td> |
26 |
| - <td><strong>Short Description</strong></td> |
27 |
| - </tr> |
28 |
| - <tr> |
29 |
| - <td>[Template Folder](/template_folder) </td> |
30 |
| - <td><a href="add-link-here">Link to the feature</a> </td> |
31 |
| - <td>Short description</td> |
32 |
| - </tr> |
33 |
| -</table> |
| 53 | +Showcases how to use tools like function calling, code execution, and grounding with Google Search to enhance Generative AI interactions. See the [Tools documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling) for more information. |
34 | 54 |
|
35 | 55 | ## Contributing
|
36 | 56 |
|
37 |
| -Contributions welcome! See the [Contributing Guide](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/CONTRIBUTING.md). |
| 57 | +Contributions are welcome! See the [Contributing Guide](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/CONTRIBUTING.md). |
38 | 58 |
|
39 |
| -## Getting help |
| 59 | +## Getting Help |
40 | 60 |
|
41 |
| -Please use the [issues page](https://github.com/GoogleCloudPlatform/python-docs-samples/issues) to provide suggestions, feedback or submit a bug report. |
| 61 | +For questions, feedback, or bug reports, please use the [issues page](https://github.com/GoogleCloudPlatform/python-docs-samples/issues). |
42 | 62 |
|
43 | 63 | ## Disclaimer
|
44 | 64 |
|
45 |
| -This repository itself is not an officially supported Google product. The code in this repository is for demonstrative purposes only. |
| 65 | +This repository is not an officially supported Google product. The code is provided for demonstrative purposes only. |
0 commit comments