You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once installed, you will have access to various Haystack Generators:
50
-
-[`VertexAIGeminiGenerator`](https://docs.haystack.deepset.ai/docs/vertexaigeminigenerator): Use this component with Gemini models '**gemini-pro**' and '**gemini-1.5-flash**' for text generation and multimodal prompts.
51
-
-[`VertexAIGeminiChatGenerator`](https://docs.haystack.deepset.ai/docs/vertexaigeminichatgenerator): Use this component with Gemini models '**gemini-pro**' and '**gemini-1.5-flash**' for text generation, multimodal prompts and function calling in chat completion setting.
50
+
-[`VertexAIGeminiGenerator`](https://docs.haystack.deepset.ai/docs/vertexaigeminigenerator): Use this component with Gemini models '**gemini-1.5-pro**', '**gemini-1.5-flash**', '**gemini-2.0-flash**' for text generation and multimodal prompts.
51
+
-[`VertexAIGeminiChatGenerator`](https://docs.haystack.deepset.ai/docs/vertexaigeminichatgenerator): Use this component with Gemini models '**gemini-1.5-pro**', '**gemini-1.5-flash**', '**gemini-2.0-flash**' for text generation, multimodal prompts and function calling in chat completion setting.
52
52
-`VertexAITextGenerator`: Use this component with PaLM models for text generation.
53
53
-`VertexAICodeGenerator`: Use this component with Codey model for code generation and code completion.
54
54
-`VertexAIImageGenerator`: Use this component with Imagen model '**imagegeneration**' for image generation.
55
55
-[`VertexAIImageCaptioner`](https://docs.haystack.deepset.ai/docs/vertexaiimagecaptioner): Use this component with Imagen model '**imagetext**' for image captioning.
56
56
-`VertexAIImageQA`: Use this component with Imagen model '**imagetext**' for visual question answering.
57
57
58
58
To use Vertex AI models, you need to have a Google Cloud Platform account and be logged in using Application Default Credentials (ADCs). For more info see the [official documentation](https://colab.research.google.com/corgiredirector?site=https%3A%2F%2Fcloud.google.com%2Fdocs%2Fauthentication%2Fprovide-credentials-adc).
59
+
`VertexAIGeminiGenerator` and `VertexAIGeminiChatGenerator` support both `gemini-1.5-pro` and `gemini-1.5-flash`/ `gemini-2.0-flash` models.
60
+
Note that [Google recommends upgrading](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions) from `gemini-1.5-pro` to `gemini-2.0-flash`.
59
61
60
62
To start using Vertex AI generators in Haystack, it is essential that your account has access to a project authorized to use Google Vertex AI endpoints. The `project_id` needed for initialization of Vertex AI generators is set during GCP authentication mentioned above. Additonally, you can also set a different `project_id` by passing it as a variable during initialization of the generator.
61
63
You can find your `project_id` in the [GCP resource manager](https://console.cloud.google.com/cloud-resource-manager) or locally by running `gcloud projects list` in your terminal. For more info on the gcloud CLI see the [official documentation](https://cloud.google.com/cli).
@@ -64,15 +66,15 @@ You can find your `project_id` in the [GCP resource manager](https://console.clo
64
66
65
67
You can leverage Gemini models through two components: [VertexAIGeminiGenerator](https://docs.haystack.deepset.ai/docs/vertexaigeminigenerator) and [VertexAIGeminiChatGenerator](https://docs.haystack.deepset.ai/docs/vertexaigeminichatgenerator). You can use these components on their own or in a pipeline.
66
68
67
-
**Text Generation with `gemini-pro`**
69
+
**Text Generation with `gemini-1.5-pro`**
68
70
69
-
To use Gemini model for text generation, initialize a `VertexAIGeminiGenerator` with `"gemini-pro"` and `project_id`:
71
+
To use Gemini model for text generation, initialize a `VertexAIGeminiGenerator` with `"gemini-1.5-pro"` and `project_id`:
70
72
71
73
```python
72
74
from haystack_integrations.components.generators.google_vertex import VertexAIGeminiGenerator
result = gemini_generator.run(parts= ["What is assemblage in art?"])
77
79
print(result["replies"][0])
78
80
```
@@ -81,9 +83,9 @@ Output:
81
83
Assemblage in art refers to the creation of a three-dimensional artwork by combining various found objects...
82
84
```
83
85
84
-
**Multimodality with `gemini-1.5-flash`**
86
+
**Multimodality with `gemini-2.0-flash`**
85
87
86
-
To use `gemini-1.5-flash` model for visual question answering, initialize a `VertexAIGeminiGenerator` with `"gemini-1.5-flash"`. Then, run it with the images as well as the prompt:
88
+
To use `gemini-2.0-flash` model for visual question answering, initialize a `VertexAIGeminiGenerator` with `"gemini-2.0-flash"`. Then, run it with the images as well as the prompt:
0 commit comments