Basic Usage
Generate embeddings using the OpenAI-compatible API:Provider-Specific Features
Input Type - Cohere
When using Cohere models via the embeddings API, you must include an additional field calledinput_type in the request. This field indicates the purpose of the embedding and must be one of the following:
search_querysearch_documentclassificationclustering
Task Types - Vertex AI & Gemini
Vertex AI and Gemini embedding models supporttask_type that optimizes embeddings for specific use cases. Specify the task type using the extra_body parameter.
Available task types: RETRIEVAL_DOCUMENT, RETRIEVAL_QUERY, QUESTION_ANSWERING, FACT_VERIFICATION, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, CODE_RETRIEVAL_QUERY
For detailed information about task types and when to use them, see:
Example:
Multimodal Embeddings - Vertex AI
Note: Multimodal embeddings are only available for the Vertex AI multimodalembedding@001 model.
Vertex AI supports multimodal embeddings that can encode images and videos along with text. This enables applications to search across multiple modalities or find semantic similarity between text and visual content.