Create sync embeddings
The EmbedClient.V2Client class provides methods to create embeddings synchronously for multimodal content. This endpoint returns embeddings immediately in the response.
Note
This class only supports Marengo version 3.0 or newer.
When to use this class:
- Create embeddings for text, images, audio, or video content
- Retrieve immediate results without waiting for background processing
- Process audio or video content up to 10 minutes in duration
Do not use this class for:
- Audio or video content longer than 10 minutes. Use the
embed.v_2.tasks.createmethod instead.
Methods
Create sync embeddings
Description: This method synchronously creates embeddings for multimodal content and returns the results immediately in the response.
Input requirements
Text:
- Maximum length: 500 tokens
Images:
- Formats: JPEG, PNG
- Minimum size: 128x128 pixels
- Maximum file size: 5 MB
Audio and video:
- Maximum duration: 10 minutes
- Maximum file size for base64 encoded strings: 36 MB
- Audio formats: WAV (uncompressed), MP3 (lossy), FLAC (lossless)
- Video formats: FFmpeg supported formats
- Video resolution: 360x360 to 3840x2160 pixels
- Aspect ratio: Between 1:1 and 1:2.4, or between 2.4:1 and 1:1
Function signature and example:
Parameters:
TextInputRequest
The TextInputRequest class specifies configuration for processing text content. Required when input_type is text.
ImageInputRequest
The ImageInputRequest class specifies configuration for processing image content. Required when input_type is image.
TextImageInputRequest
The TextImageInputRequest class specifies configuration for processing combined text and image content. Required when input_type is text_image.
AudioInputRequest
The AudioInputRequest class specifies configuration for processing audio content. Required when input_type is audio.
VideoInputRequest
The VideoInputRequest class specifies configuration for processing video content. Required when input_type is video.
MediaSource
The MediaSource class specifies the source of the media file. Provide exactly one of the following:
AudioSegmentation
The AudioSegmentation class specifies how the platform divides the audio into segments using fixed-length intervals.
AudioSegmentationFixed
The AudioSegmentationFixed class configures fixed-length segmentation for audio.
VideoSegmentation
The 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:
VideoSegmentationFixedFixed
The VideoSegmentationFixedFixed class configures fixed-length segmentation for video.
VideoSegmentationDynamicDynamic
The VideoSegmentationDynamicDynamic class configures dynamic segmentation for video based on scene changes.
Return value: Returns an EmbeddingSuccessResponse object containing the embedding results.
The EmbeddingSuccessResponse class contains the following properties:
The EmbeddingData class contains the following properties:
API Reference: Create sync embeddings