The EmbedClient.V2Client class provides methods to create embeddings synchronously for multimodal content, returning embeddings immediately in the response.
When to use this class:
Do not use this class for:
embed.v_2.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:
Function signature and example
The TextInputRequest class specifies the configuration for processing text content. Required when input_type is text.
The ImageInputRequest class specifies the configuration for processing image content. Required when input_type is image.
The TextImageInputRequest class specifies the configuration for processing combined text and image content. Required when input_type is text_image.
The AudioInputRequest class specifies the configuration for processing audio content. Required when input_type is audio.
The VideoInputRequest class specifies the configuration for processing video content. Required when input_type is video.
The MultiInputRequest class specifies the configuration for processing multiple images and optional text. Required when input_type is multi_input.
The MediaSource class 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, base64_string, or asset_id.
The AudioSegmentation class specifies how the platform divides the audio into segments using fixed-length intervals.
The AudioSegmentationFixed class configures fixed-length segmentation for audio.
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:
The VideoSegmentationFixedFixed class configures fixed-length segmentation for video.
The VideoSegmentationDynamicDynamic class configures dynamic segmentation for video based on scene changes.
Returns an EmbeddingSuccessResponse object containing the embedding results.
The EmbeddingSuccessResponse class contains the following properties:
The EmbeddingData class contains the following properties: