The SDK provides methods to create text, image, and audio embeddings.
Description: This method creates a new embedding.
Ensure your media files meet the following requirements:
Note that you must specify at least the following parameters:
modelName: The name of the video understanding model to use.
One or more of the following input types:
text: For text embeddingsaudioUrl or audioFile: For audio embeddings. If you specify both, the audioUrl parameter takes precedence.imageUrl or imageFile: For image embeddings. If you specify both, the imageUrl parameter takes precedence.You must provide at least one input type, but you can include multiple types in a single function call.
This method is rate-limited. For details, see the Rate limits page.
Function signature and example:
Returns an HttpResponsePromise that resolves to an EmbeddingResponse object containing the embedding results.
The EmbeddingResponse interface contains the following properties:
The TextEmbeddingResult interface contains the following properties:
The ImageEmbeddingResult interface contains the following properties:
The AudioEmbeddingResult interface contains the following properties:
The BaseSegment interface contains the following properties:
The AudioSegment interface extends BaseSegment and contains the following additional properties:
The BaseEmbeddingMetadata interface contains the following properties:
Create text, image, and audio embeddings.
This section lists the most common error messages you may encounter while creating text, image, and audio embeddings.
parameter_invalid
text parameter is invalid. The text token length should be less than or equal to 77.text_truncate parameter is invalid. You should use one of the following values: none, start, end.For a list of general errors that apply to all endpoints, see the Error codes page.