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
Copy file name to clipboardExpand all lines: integrations/google-vertex-ai.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,16 @@ toc: true
23
23
-[Installation](#installation)
24
24
-[Usage](#usage)
25
25
-[Gemini API models](#gemini-api-models)
26
+
-[Text Embedder API models](#text-embedder-api-models)
26
27
-[PaLM API models](#palm-api-models)
27
28
-[Codey API models](#codey-api-models)
28
29
-[Imagen API models](#imagen-api-models)
29
30
30
31
## Overview
31
32
32
-
[Vertex AI](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview) 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. This integration enables the usage of [models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) through Vertex AI API on Google Cloud Platform (GCP).
33
+
[Vertex AI](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview) 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. This integration enables the usage of [generative models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models) and [embedding models](https://cloud.google.com/vertex-ai/generative-ai/docs/models#embeddings-models) through Vertex AI API on Google Cloud Platform (GCP).
33
34
34
-
Haystack supports [Gemini API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#gemini-models), [PaLM API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#palm-models), [Codey APIs models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#codey-models), and [Imagen API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#imagen-models) for task such as **text generation**, **function calling**, **image generation**, **visual question answering**, **code generation**, and **image captioning**.
35
+
Haystack supports [Gemini API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#gemini-models), [PaLM API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#palm-models), [Codey APIs models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#codey-models), and [Imagen API models](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/models#imagen-models)and [](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api)for task such as **text generation**, **function calling**, **image generation**, **visual question answering**, **code generation**, and **image captioning** as well as **embedding generation**.
35
36
36
37
> To learn more about the use cases and test Vertex AI models with Haystack, follow this [Notebook](https://haystack.deepset.ai/cookbook/vertexai-gemini-examples).
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-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
-
-`VertexAITextGenerator`: Use this component with PaLM models for text generation.
53
-
-`VertexAICodeGenerator`: Use this component with Codey model for code generation and code completion.
54
-
-`VertexAIImageGenerator`: Use this component with Imagen model '**imagegeneration**' for image generation.
55
-
-[`VertexAIImageCaptioner`](https://docs.haystack.deepset.ai/docs/vertexaiimagecaptioner): Use this component with Imagen model '**imagetext**' for image captioning.
56
-
-`VertexAIImageQA`: Use this component with Imagen model '**imagetext**' for visual question answering.
50
+
Once installed, you will have access to various Haystack Generators and Embedders:
51
+
-[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.
52
+
-[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.
53
+
-[VertexAITextGenerator](https://docs.haystack.deepset.ai/docs/vertexaitextgenerator): Use this component with PaLM models for text generation.
54
+
-[VertexAICodeGenerator](https://docs.haystack.deepset.ai/docs/vertexaicodegenerator): Use this component with Codey model for code generation and code completion.
55
+
-[VertexAIImageGenerator](https://docs.haystack.deepset.ai/docs/vertexaiimagegenerator): Use this component with Imagen model '**imagegeneration**' for image generation.
56
+
-[VertexAIImageCaptioner](https://docs.haystack.deepset.ai/docs/vertexaiimagecaptioner): Use this component with Imagen model '**imagetext**' for image captioning.
57
+
-[VertexAIImageQA](https://docs.haystack.deepset.ai/docs/vertexaiimageqa): Use this component with Imagen model '**imagetext**' for visual question answering.
58
+
-`VertexAITextEmbedder`: Use this component to create embeddings for text data using Vertex AI Text Embedder API.
59
+
-`VertexAIDocumentEmbedder`: Use this component to create embeddings for Document using Vertex AI Text Embedder API.
57
60
58
61
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
62
`VertexAIGeminiGenerator` and `VertexAIGeminiChatGenerator` support both `gemini-1.5-pro` and `gemini-1.5-flash`/ `gemini-2.0-flash` models.
@@ -117,6 +120,21 @@ The fourth image is of Marvin from the 1977 film The Hitchhiker's Guide to the G
117
120
118
121
*For function calling with `gemini-1.5-pro`, refer to the [Notebook](https://haystack.deepset.ai/cookbook/vertexai-gemini-examples).*
119
122
123
+
### Text Embedder API models
124
+
125
+
You can leverage Text Embedder API models `text-embedding-005`, `text-multilingual-embedding-002`, `text-embedding-large-exp-03-07`, `text-embedding-004`, and `textembedding-gecko-multilingual@001`.
126
+
127
+
```python
128
+
from haystack_integrations.components.embedders.google_vertex import VertexAITextEmbedder
You can leverage PaLM API models `text-bison`, `text-unicorn` and `text-bison-32k` through `VertexAITextGenerator` for task generation. To use PaLM models, initialize a `VertexAITextGenerator` with model name.
0 commit comments