Create text, image, and audio embeddings
The Resources.Embed
class provides methods to create text, image, and audio embeddings.
Create text, image, and audio embeddings
Description: This method creates a new embedding.
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
oraudioFile
: For audio embeddings. If you specify both, the audioUrl parameter takes precedence.imageUrl
orimageFile
: For image embeddings. If you specify both, theimageUrl
parameter takes precedence.
You must provide at least one input type, but you can include multiple types in a single function call.
Function signature and example:
Parameters:
The CreateEmbedParams
interface defines the parameters for creating a text embedding.
Return value: Returns a Promise
that resolves to a Models.CreateEmbeddingsResult
instance.
API Reference: For a description of each field in the request and response, see the Create text, image, and audio embeddings page.
Related guide:
Error codes
This section lists the most common error messages you may encounter while using the Resources.Embed
class.
parameter_invalid
- The
text
parameter is invalid. The text token length should be less than or equal to 77. - The
text_truncate
parameter is invalid. You should use one of the following values:none
,start
,end
.
- The