Create video embeddings
The resources.EmbedTask
class provides methods to create embeddings for your videos.
To create video embeddings:
- Create a video embedding task that uploads and processes a video.
- Monitor the status of your task.
- Retrieve the embeddings once the task is completed.
Methods
Create a video embedding task
Description: This method creates a new video embedding task.
Function signature and example:
Parameters:
Return value: Returns a models.EmbeddingsTask
object representing the new video embedding task.
API Reference: For a description of each field in the request and response, see the Create a video embedding task page.
Related guide: Create video embeddings.
Retrieve the status of a video embedding task
Description: This method retrieves the status of a video embedding task.
Function signature and example:
Parameters:
Return value: Returns a models.EmbeddingsTaskStatus
object containing the current status of the embedding task.
Note
You can also use the wait_for_done
method of the models.EmbeddingTask
class to monitor the status of a video indexing task until it completes.
API Reference: For a description of each field in the response, see the Retrieve the status of a video embedding task page.
Related guide: Create video embeddings.
Retrieve video embeddings
Description: This method retrieves embeddings for a specific video embedding task. Ensure the task status is ready
before retrieving your embeddings.
Function signature and example:
Parameters:
Return value: Returns a models.EmbeddingsTask
object containing the details of the embedding task, including the embeddings if available. The video_embeddings
property of the returned object is a RootModelList
of VideoEmbedding
objects when the task is completed, or None
if the embeddings are not yet available.
API Reference: For a description of each field in the response, see the Retrieve video embeddings page.
Related guide: Create video embeddings.