The TwelveLabs Python SDK provides a set of intuitive classes and methods that streamline platform interaction, minimizing the need for boilerplate code. It offers a robust interface for interacting with the TwelveLabs Video Understanding Platform, simplifying authentication and efficiently processing asynchronous tasks. The current version is 1.2.2 and releases are frequent, with breaking changes typically announced with major model updates or API shifts.
pip install twelvelabsVerified import paths — ran on the pinned version, not inferred.
Initializes the TwelveLabs client using an API key from an environment variable and lists existing indexes to confirm a successful connection.
Refer to the official migration guides and documentation for detailed instructions on updating your code (e.g., API parameter changes, object structures).
Consult the TwelveLabs release notes and migration guides for Marengo 3.0 to update model names and options in your `IndexesCreateRequestModelsItem`.
Update your deletion workflow to first delete any associated indexed assets or explicitly detach assets from indexes before attempting to delete the raw asset. Use the `force` query parameter on the DELETE method for assets if you intend to override this behavior (use with caution).
Migrate from Marengo 2.7 to Marengo 3.0 or later. Replace usage of `/gist` and `/summarize` with the `/analyze` endpoint, which offers more flexible and structured text generation capabilities.
Ensure your `TWELVELABS_API_KEY` environment variable is correctly set, or that the `api_key` argument passed to `TwelveLabs()` is valid and current. Generate a new API key from the TwelveLabs dashboard if necessary.
Choose a unique name for your new index. Alternatively, before creating an index, use `client.indexes.list()` to check for existing indexes and handle potential name conflicts (e.g., delete the old index or reuse its ID).
Carefully review the specific error message to identify the problematic parameter. Consult the TwelveLabs Python SDK documentation or API reference for that particular method to ensure all parameters are correctly formatted and contain valid values.