The TwelveLabs
class is the main entry point for the SDK. It initializes the client and provides access to all the resources.
Properties
Name | Type | Description |
---|---|---|
engine | resources.Engine | Use this object to manage video understanding engines. |
index | resources.Index | Use this object to manage your indexes. |
task | resources.Task | Use this object to upload videos and manage them. |
search | resources.Search | Use this object to perform search requests. |
classify | resources.Classify | Use this object to classify videos. |
generate | resources.Generate | Use this object to generate text from videos. |
embed | resources.Embed | Use 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:
Name | Type | Required | Description |
---|---|---|---|
api_key | str | Yes | Your Twelve Labs API key. |
version | Literal["v1.1", "v1.2"]] | No | The API version to use. Defaults to the latest version. |
Return value: None. This method initializes the instance.