The Twelve Labs class

The TwelveLabs class is the main entry point for the SDK. It initializes the client and provides access to all the resources.

Properties

NameTypeDescription
engineresources.EngineUse this object to manage video understanding engines.
indexresources.IndexUse this object to manage your indexes.
taskresources.TaskUse this object to upload videos and manage them.
searchresources.SearchUse this object to perform search requests.
classifyresources.ClassifyUse this object to classify videos.
generateresources.GenerateUse this object to generate text from videos.
embedresources.EmbedUse this object to create embeddings.

Methods

The initializer

Description: The constructor creates a new instance of the TwelveLabs class.

Function signature and example:

def __init__(
    self,
    api_key: str,
    version: Union[str, Literal["v1.1", "v1.2"]] = DEFAULT_API_VERSION
) -> None
client = TwelveLabs(api_key="<YOUR_API_KEY>")

Parameters:

NameTypeRequiredDescription
api_keystrYesYour Twelve Labs API key.
versionLiteral["v1.1", "v1.2"]]NoThe API version to use. Defaults to the latest version.

Return value: None. This method initializes the instance.