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 constructor
Description: The constructor creates a new instance of the TwelveLabs class.
Function signature and example:
constructor({ apiKey, version = DEFAULT_API_VERSION }: ClientOptions)
const client = new TwelveLabs({ apiKey: '<YOUR_API_KEY>' });
Parameters:
Name | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | Your Twelve Labs API key. |
version | string | No | The API version to use. Defaults to the latest version. |
Return value: Implicitly returns the newly created instance.