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

Properties

NameTypeDescription
indexresources.IndexUse this object to manage your indexes.
taskresources.TaskUse this object to upload videos.
searchresources.SearchUse this object to perform search requests.
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", "v1.3"]] = DEFAULT_API_VERSION
) -> None
client = TwelveLabs(api_key="<YOUR_API_KEY>")

Parameters:

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

Return value: None. This method initializes the instance.