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:
-
model_name
: The name of the video understanding model to use. -
One or more of the following input types:
text
: For text embeddingsaudio_url
oraudio_file
: For audio embeddings. If you specify both, theaudio_url
parameter takes precedence.image_url
orimage_file
: For image embeddings. If you specify both, theimage_url
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:
Return value: Returns a models.CreateEmbeddingsResult
object containing the embedding results.
API Reference: For a description of each field in the request and response, see the Create text, audio, and image embeddings page.
Related guides: