Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twelvelabs fix #9199

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/integrations/ai-engines/twelvelabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ When executing the `CREATE MODEL` statement, the following parameters are suppor
- `twelve_labs_api_key`: The Twelve Labs API key to use for authentication, if the ML Engine is not provided.
- `base_url`: The base URL of the Twelve Labs API. This is an optional parameter and defaults to `https://api.twelvelabs.io/v1.2`.
- `task`: The task to perform. This is a required parameter and must be one of `search` or `summarization`.
- `engine_id`: The ID of the Twelve Labs engine to use. This is an optional parameter and defaults to `marengo2.5`. However, certain tasks may require a different engine ID; for instance, the `summarization` task runs only on the Pegasus family of engines. More information about the different engines can be found [here](https://docs.twelvelabs.io/v1.2/docs/engine-options).
- `engine_id`: The ID of the Twelve Labs engine to use. This is an optional parameter and defaults to `marengo2.6`. However, certain tasks may require a different engine ID; for instance, the `summarization` task runs only on the Pegasus family of engines. More information about the different engines can be found [here](https://docs.twelvelabs.io/v1.2/docs/engine-options).
- `index_name`: The name of the index to use; if it does not exist, it will be created. This is a required parameter. More information about indexes can be found [here](https://docs.twelvelabs.io/docs/create-indexes).
- `index_options`: A list of the types of information within the video that will be processed by the video understanding engine. This is a required parameter and can be any combination of `visual`, `conversation`, `text_in_video` and `logo`. More information about index options can be found [here](https://docs.twelvelabs.io/docs/indexing-options). Certain engines support only a subset of these options; for instance, the Pegasus family of engines only support the `visual` and `conversation` options. More information about the about these configurations can be found [here](https://docs.twelvelabs.io/v1.2/docs/create-indexes).
- `video_urls`: A list of URLs to the videos to be indexed. This is an optional parameter, but if not specified, one of `video_files`, `video_urls_column` or `video_files_column` must be specified instead.
Expand All @@ -67,7 +67,7 @@ USING
index_options = ['visual', 'conversation', 'text_in_video', 'logo'],
video_urls = ['https://.../video_1.mp4', 'https://.../video_2.mp4'],
search_options = ['visual', 'conversation', 'text_in_video', 'logo'],
query_column = 'query'
search_query_column = 'query'
```

As mentioned above, the `search_options` parameter is specific to the `search` task and should be a subset of `index_options`.
Expand Down Expand Up @@ -99,7 +99,7 @@ FROM mindsdb.twelve_labs_search
WHERE query = 'search query';
```

Here, the `query` column is the name of the column containing the search queries as specified in the `query_column` parameter of the `CREATE MODEL` statement.
Here, the `query` column is the name of the column containing the search queries as specified in the `search_query_column` parameter of the `CREATE MODEL` statement.

Note: At the moment, only a single query can be specified in the `WHERE` clause of the query. The `JOIN` clause for making multiple predictions will be added in a future release.

Expand Down
4 changes: 2 additions & 2 deletions mindsdb/integrations/handlers/twelve_labs_handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When executing the `CREATE MODEL` statement, the following parameters are suppor
- `twelve_labs_api_key`: The Twelve Labs API key to use for authentication, if the ML Engine is not provided.
- `base_url`: The base URL of the Twelve Labs API. This is an optional parameter and defaults to `https://api.twelvelabs.io/v1.2`.
- `task`: The task to perform. This is a required parameter and must be one of `search` or `summarization`.
- `engine_id`: The ID of the Twelve Labs engine to use. This is an optional parameter and defaults to `marengo2.5`. However, certain tasks may require a different engine ID; for instance, the `summarization` task runs only on the Pegasus family of engines. More information about the different engines can be found [here](https://docs.twelvelabs.io/v1.2/docs/engine-options).
- `engine_id`: The ID of the Twelve Labs engine to use. This is an optional parameter and defaults to `marengo2.6`. However, certain tasks may require a different engine ID; for instance, the `summarization` task runs only on the Pegasus family of engines. More information about the different engines can be found [here](https://docs.twelvelabs.io/v1.2/docs/engine-options).
- `index_name`: The name of the index to use; if it does not exist, it will be created. This is a required parameter. More information about indexes can be found [here](https://docs.twelvelabs.io/docs/create-indexes).
- `index_options`: A list of the types of information within the video that will be processed by the video understanding engine. This is a required parameter and can be any combination of `visual`, `conversation`, `text_in_video` and `logo`. More information about index options can be found [here](https://docs.twelvelabs.io/docs/indexing-options). Certain engines support only a subset of these options; for instance, the Pegasus family of engines only support the `visual` and `conversation` options. More information about the about these configurations can be found [here](https://docs.twelvelabs.io/v1.2/docs/create-indexes).
- `video_urls`: A list of URLs to the videos to be indexed. This is an optional parameter, but if not specified, one of `video_files`, `video_urls_column` or `video_files_column` must be specified instead.
Expand Down Expand Up @@ -87,7 +87,7 @@ FROM mindsdb.twelve_labs_search
WHERE query = 'search query';
```

Here, the `query` column is the name of the column containing the search queries as specified in the `query_column` parameter of the `CREATE MODEL` statement.
Here, the `query` column is the name of the column containing the search queries as specified in the `search_query_column` parameter of the `CREATE MODEL` statement.

Note: At the moment, only a single query can be specified in the `WHERE` clause of the query. The `JOIN` clause for making multiple predictions will be added in a future release.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ class TwelveLabsHandlerConfig(BaseSettings):
DEFAULT_WAIT_DURATION : int
Default wait duration when polling video indexing tasks created via the Twelve Labs API.
"""

BASE_URL: str = "https://api.twelvelabs.io/v1.2"
DEFAULT_ENGINE: str = "marengo2.5"
DEFAULT_ENGINE: str = "marengo2.6"
DEFAULT_WAIT_DURATION: int = 5


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create_index(self, index_name: str, index_options: List[str], engine_id: Opt
body = {
"index_name": index_name,
"engines": [{
"engine_name": engine_id if engine_id else twelve_labs_handler_config.DEFAULT_ENGINE_ID,
"engine_name": engine_id if engine_id else twelve_labs_handler_config.DEFAULT_ENGINE,
"engine_options": index_options
}],
"addons": addons,
Expand Down