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 |
---|---|---|
index | resources.Index | Use this object to manage your indexes. |
task | resources.Task | Use this object to upload videos. |
search | resources.Search | Use this object to perform search requests. |
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", "v1.3"]] = 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", "v1.3"] | No | The API version to use. Defaults to the latest version. |
Return value: None. This method initializes the instance.