The Embed.V2 interface provides methods to create embeddings synchronously for multimodal content. It returns embeddings immediately in the response.
When to use this interface:
Do not use this interface for:
embed.v2.tasks.create method instead.Description: This method synchronously creates embeddings for multimodal content and returns the results immediately in the response.
Text:
Images:
Audio and video:
This method is rate-limited. For details, see the Rate limits page.
Function signature and example:
The TwelvelabsApi.embed.CreateEmbeddingsRequest interface has the following properties:
The TwelvelabsApi.TextInputRequest interface specifies the configuration for processing text content. Required when inputType is text.
The TwelvelabsApi.ImageInputRequest interface specifies the configuration for processing image content. Required when inputType is image.
The TwelvelabsApi.TextImageInputRequest interface specifies the configuration for processing combined text and image content. Required when inputType is text_image.
The TwelvelabsApi.AudioInputRequest interface specifies the configuration for processing audio content. Required when inputType is audio.
The TwelvelabsApi.VideoInputRequest interface specifies the configuration for processing video content. Required when inputType is video.
The MultiInputRequest class specifies the configuration for processing multiple images and optional text. Required when inputType is multi_input.
The TwelvelabsApi.MediaSource interface specifies the source of the media file. Provide exactly one of the following:
A class specifying an image source for multi-input embeddings. You must provide exactly one of url, base64String, or assetId.
The TwelvelabsApi.AudioSegmentation interface specifies how the platform divides the audio into segments using fixed-length intervals.
The TwelvelabsApi.AudioSegmentationFixed interface configures fixed-length segmentation for audio.
The TwelvelabsApi.VideoSegmentation type specifies how the platform divides the video into segments. Use one of the following:
Fixed segmentation: Divides the video into equal-length segments:
Dynamic segmentation: Divides the video into adaptive segments based on scene changes:
The TwelvelabsApi.VideoSegmentationFixedFixed interface configures fixed-length segmentation for video.
The TwelvelabsApi.VideoSegmentationDynamicDynamic interface configures dynamic segmentation for video based on scene changes.
Returns an HttpResponsePromise that resolves to a TwelvelabsApi.EmbeddingSuccessResponse object containing the embedding results.
The TwelvelabsApi.EmbeddingSuccessResponse interface contains the following properties:
The TwelvelabsApi.EmbeddingData interface contains the following properties: