twelvelabs-js 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +14 -38
- package/Client.js +22 -42
- package/api/client/requests/AnalyzeRequest.d.ts +42 -29
- package/api/client/requests/AnalyzeStreamRequest.d.ts +42 -29
- package/api/resources/analyzeAsync/resources/tasks/client/Client.d.ts +61 -4
- package/api/resources/analyzeAsync/resources/tasks/client/Client.js +73 -13
- package/api/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.d.ts +111 -9
- package/api/resources/analyzeAsync/resources/tasks/client/requests/TasksListRequest.d.ts +8 -2
- package/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.d.ts +7 -2
- package/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.js +1 -0
- package/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestModelName.d.ts +4 -2
- package/api/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.d.ts +2 -1
- package/api/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.js +1 -0
- package/api/resources/assets/client/Client.d.ts +4 -1
- package/api/resources/assets/client/Client.js +12 -9
- package/api/resources/assets/client/requests/AssetsCreateRequest.d.ts +1 -1
- package/api/resources/embed/client/Client.js +2 -2
- package/api/resources/embed/resources/tasks/client/Client.js +8 -8
- package/api/resources/embed/resources/v2/client/Client.js +2 -2
- package/api/resources/embed/resources/v2/resources/tasks/client/Client.d.ts +1 -1
- package/api/resources/embed/resources/v2/resources/tasks/client/Client.js +7 -7
- package/api/resources/entityCollections/client/Client.js +10 -10
- package/api/resources/entityCollections/resources/entities/client/Client.js +18 -18
- package/api/resources/indexes/client/Client.js +10 -10
- package/api/resources/indexes/resources/indexedAssets/client/Client.js +12 -12
- package/api/resources/indexes/resources/videos/client/Client.js +8 -8
- package/api/resources/multipartUpload/client/Client.d.ts +2 -2
- package/api/resources/multipartUpload/client/Client.js +12 -12
- package/api/resources/search/client/Client.js +4 -4
- package/api/resources/tasks/client/Client.js +8 -8
- package/api/resources/tasks/resources/transfers/client/Client.js +6 -6
- package/api/types/AnalyzePromptV2.d.ts +13 -0
- package/api/types/AnalyzePromptV2.js +5 -0
- package/api/types/AnalyzeRequestModelName.d.ts +15 -0
- package/api/types/AnalyzeRequestModelName.js +10 -0
- package/api/types/AnalyzeStreamRequestModelName.d.ts +15 -0
- package/api/types/AnalyzeStreamRequestModelName.js +10 -0
- package/api/types/AnalyzeTaskResponse.d.ts +3 -1
- package/api/types/AnalyzeTaskResponseRequestParams.d.ts +20 -2
- package/api/types/AnalyzeTaskResponseRequestParamsPromptV2.d.ts +16 -0
- package/api/types/AnalyzeTaskResponseRequestParamsPromptV2.js +5 -0
- package/api/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.d.ts +11 -0
- package/api/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.js +5 -0
- package/api/types/AnalyzeTaskResponseRequestParamsResponseFormat.d.ts +14 -1
- package/api/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.d.ts +2 -0
- package/api/types/AnalyzeTaskResponseVideoSource.d.ts +2 -0
- package/api/types/AnalyzeTaskResultUsage.d.ts +1 -1
- package/api/types/AnalyzeTimeRange.d.ts +12 -0
- package/api/types/AnalyzeTimeRange.js +5 -0
- package/api/types/AsyncResponseFormat.d.ts +34 -6
- package/api/types/SegmentDefinition.d.ts +11 -0
- package/api/types/SyncResponseFormat.d.ts +25 -6
- package/api/types/TokenUsage.d.ts +3 -1
- package/api/types/index.d.ts +6 -0
- package/api/types/index.js +6 -0
- package/dist/Client.d.ts +14 -38
- package/dist/Client.js +22 -42
- package/dist/api/client/requests/AnalyzeRequest.d.ts +42 -29
- package/dist/api/client/requests/AnalyzeStreamRequest.d.ts +42 -29
- package/dist/api/resources/analyzeAsync/resources/tasks/client/Client.d.ts +61 -4
- package/dist/api/resources/analyzeAsync/resources/tasks/client/Client.js +73 -13
- package/dist/api/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.d.ts +111 -9
- package/dist/api/resources/analyzeAsync/resources/tasks/client/requests/TasksListRequest.d.ts +8 -2
- package/dist/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.d.ts +7 -2
- package/dist/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.js +1 -0
- package/dist/api/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestModelName.d.ts +4 -2
- package/dist/api/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.d.ts +2 -1
- package/dist/api/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.js +1 -0
- package/dist/api/resources/assets/client/Client.d.ts +4 -1
- package/dist/api/resources/assets/client/Client.js +12 -9
- package/dist/api/resources/assets/client/requests/AssetsCreateRequest.d.ts +1 -1
- package/dist/api/resources/embed/client/Client.js +2 -2
- package/dist/api/resources/embed/resources/tasks/client/Client.js +8 -8
- package/dist/api/resources/embed/resources/v2/client/Client.js +2 -2
- package/dist/api/resources/embed/resources/v2/resources/tasks/client/Client.d.ts +1 -1
- package/dist/api/resources/embed/resources/v2/resources/tasks/client/Client.js +7 -7
- package/dist/api/resources/entityCollections/client/Client.js +10 -10
- package/dist/api/resources/entityCollections/resources/entities/client/Client.js +18 -18
- package/dist/api/resources/indexes/client/Client.js +10 -10
- package/dist/api/resources/indexes/resources/indexedAssets/client/Client.js +12 -12
- package/dist/api/resources/indexes/resources/videos/client/Client.js +8 -8
- package/dist/api/resources/multipartUpload/client/Client.d.ts +2 -2
- package/dist/api/resources/multipartUpload/client/Client.js +12 -12
- package/dist/api/resources/search/client/Client.js +4 -4
- package/dist/api/resources/tasks/client/Client.js +8 -8
- package/dist/api/resources/tasks/resources/transfers/client/Client.js +6 -6
- package/dist/api/types/AnalyzePromptV2.d.ts +13 -0
- package/dist/api/types/AnalyzePromptV2.js +5 -0
- package/dist/api/types/AnalyzeRequestModelName.d.ts +15 -0
- package/dist/api/types/AnalyzeRequestModelName.js +10 -0
- package/dist/api/types/AnalyzeStreamRequestModelName.d.ts +15 -0
- package/dist/api/types/AnalyzeStreamRequestModelName.js +10 -0
- package/dist/api/types/AnalyzeTaskResponse.d.ts +3 -1
- package/dist/api/types/AnalyzeTaskResponseRequestParams.d.ts +20 -2
- package/dist/api/types/AnalyzeTaskResponseRequestParamsPromptV2.d.ts +16 -0
- package/dist/api/types/AnalyzeTaskResponseRequestParamsPromptV2.js +5 -0
- package/dist/api/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.d.ts +11 -0
- package/dist/api/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.js +5 -0
- package/dist/api/types/AnalyzeTaskResponseRequestParamsResponseFormat.d.ts +14 -1
- package/dist/api/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.d.ts +2 -0
- package/dist/api/types/AnalyzeTaskResponseVideoSource.d.ts +2 -0
- package/dist/api/types/AnalyzeTaskResultUsage.d.ts +1 -1
- package/dist/api/types/AnalyzeTimeRange.d.ts +12 -0
- package/dist/api/types/AnalyzeTimeRange.js +5 -0
- package/dist/api/types/AsyncResponseFormat.d.ts +34 -6
- package/dist/api/types/SegmentDefinition.d.ts +11 -0
- package/dist/api/types/SyncResponseFormat.d.ts +25 -6
- package/dist/api/types/TokenUsage.d.ts +3 -1
- package/dist/api/types/index.d.ts +6 -0
- package/dist/api/types/index.js +6 -0
- package/dist/serialization/client/requests/AnalyzeRequest.d.ts +8 -3
- package/dist/serialization/client/requests/AnalyzeRequest.js +8 -3
- package/dist/serialization/client/requests/AnalyzeStreamRequest.d.ts +8 -3
- package/dist/serialization/client/requests/AnalyzeStreamRequest.js +8 -3
- package/dist/serialization/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.d.ts +5 -0
- package/dist/serialization/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.js +5 -0
- package/dist/serialization/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.d.ts +1 -1
- package/dist/serialization/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.js +1 -1
- package/dist/serialization/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.d.ts +1 -1
- package/dist/serialization/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.js +1 -1
- package/dist/serialization/types/AnalyzePromptV2.d.ts +14 -0
- package/dist/serialization/types/AnalyzePromptV2.js +45 -0
- package/dist/serialization/types/AnalyzeRequestModelName.d.ts +10 -0
- package/dist/serialization/types/AnalyzeRequestModelName.js +41 -0
- package/dist/serialization/types/AnalyzeStreamRequestModelName.d.ts +10 -0
- package/dist/serialization/types/AnalyzeStreamRequestModelName.js +41 -0
- package/dist/serialization/types/AnalyzeTaskResponse.d.ts +1 -0
- package/dist/serialization/types/AnalyzeTaskResponse.js +1 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParams.d.ts +5 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParams.js +5 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2.d.ts +14 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2.js +45 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.d.ts +15 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.js +46 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormat.d.ts +1 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormat.js +1 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.d.ts +2 -0
- package/dist/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.js +2 -0
- package/dist/serialization/types/AnalyzeTaskResponseVideoSource.d.ts +1 -0
- package/dist/serialization/types/AnalyzeTaskResponseVideoSource.js +1 -0
- package/dist/serialization/types/AnalyzeTimeRange.d.ts +13 -0
- package/dist/serialization/types/AnalyzeTimeRange.js +44 -0
- package/dist/serialization/types/SegmentDefinition.d.ts +2 -0
- package/dist/serialization/types/SegmentDefinition.js +2 -0
- package/dist/serialization/types/TokenUsage.d.ts +2 -1
- package/dist/serialization/types/TokenUsage.js +2 -1
- package/dist/serialization/types/index.d.ts +6 -0
- package/dist/serialization/types/index.js +6 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +21 -40
- package/serialization/client/requests/AnalyzeRequest.d.ts +8 -3
- package/serialization/client/requests/AnalyzeRequest.js +8 -3
- package/serialization/client/requests/AnalyzeStreamRequest.d.ts +8 -3
- package/serialization/client/requests/AnalyzeStreamRequest.js +8 -3
- package/serialization/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.d.ts +5 -0
- package/serialization/resources/analyzeAsync/resources/tasks/client/requests/CreateAsyncAnalyzeRequest.js +5 -0
- package/serialization/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.d.ts +1 -1
- package/serialization/resources/analyzeAsync/resources/tasks/types/CreateAsyncAnalyzeRequestAnalysisMode.js +1 -1
- package/serialization/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.d.ts +1 -1
- package/serialization/resources/analyzeAsync/resources/tasks/types/TasksListRequestAnalysisMode.js +1 -1
- package/serialization/types/AnalyzePromptV2.d.ts +14 -0
- package/serialization/types/AnalyzePromptV2.js +45 -0
- package/serialization/types/AnalyzeRequestModelName.d.ts +10 -0
- package/serialization/types/AnalyzeRequestModelName.js +41 -0
- package/serialization/types/AnalyzeStreamRequestModelName.d.ts +10 -0
- package/serialization/types/AnalyzeStreamRequestModelName.js +41 -0
- package/serialization/types/AnalyzeTaskResponse.d.ts +1 -0
- package/serialization/types/AnalyzeTaskResponse.js +1 -0
- package/serialization/types/AnalyzeTaskResponseRequestParams.d.ts +5 -0
- package/serialization/types/AnalyzeTaskResponseRequestParams.js +5 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2.d.ts +14 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2.js +45 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.d.ts +15 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsPromptV2MediaSourcesItem.js +46 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormat.d.ts +1 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormat.js +1 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.d.ts +2 -0
- package/serialization/types/AnalyzeTaskResponseRequestParamsResponseFormatSegmentDefinitionsItem.js +2 -0
- package/serialization/types/AnalyzeTaskResponseVideoSource.d.ts +1 -0
- package/serialization/types/AnalyzeTaskResponseVideoSource.js +1 -0
- package/serialization/types/AnalyzeTimeRange.d.ts +13 -0
- package/serialization/types/AnalyzeTimeRange.js +44 -0
- package/serialization/types/SegmentDefinition.d.ts +2 -0
- package/serialization/types/SegmentDefinition.js +2 -0
- package/serialization/types/TokenUsage.d.ts +2 -1
- package/serialization/types/TokenUsage.js +2 -1
- package/serialization/types/index.d.ts +6 -0
- package/serialization/types/index.js +6 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class TwelvelabsApiClient {
|
|
|
50
50
|
get search(): Search;
|
|
51
51
|
get analyzeAsync(): AnalyzeAsync;
|
|
52
52
|
/**
|
|
53
|
-
* This method
|
|
53
|
+
* This method analyzes your videos and returns the results directly in the response. It generates text based on your prompts and supports both Pegasus 1.2 and Pegasus 1.5 for general analysis (prompt-based text generation).
|
|
54
54
|
*
|
|
55
55
|
* <Accordion title="Input requirements">
|
|
56
56
|
* - Minimum duration: 4 seconds
|
|
@@ -62,21 +62,21 @@ export declare class TwelvelabsApiClient {
|
|
|
62
62
|
*
|
|
63
63
|
* **When to use this method**:
|
|
64
64
|
* - Analyze videos up to 1 hour
|
|
65
|
-
* - Retrieve immediate results without
|
|
66
|
-
* - Stream text fragments in real
|
|
65
|
+
* - Retrieve immediate results without polling for task completion
|
|
66
|
+
* - Stream text fragments in real time for immediate processing and feedback
|
|
67
67
|
*
|
|
68
68
|
* **Do not use this method for**:
|
|
69
69
|
* - Videos longer than 1 hour. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
70
|
-
* - Video segmentation. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with `model_name` set to `pegasus1.5` instead.
|
|
70
|
+
* - Video segmentation with custom segment definitions. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with the `model_name` parameter set to `pegasus1.5` instead.
|
|
71
71
|
*
|
|
72
|
-
* <Note title="
|
|
73
|
-
*
|
|
72
|
+
* <Note title="Note">
|
|
73
|
+
* This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page.
|
|
74
74
|
* </Note>
|
|
75
75
|
*/
|
|
76
76
|
analyzeStream(request: TwelvelabsApi.AnalyzeStreamRequest, requestOptions?: TwelvelabsApiClient.RequestOptions): core.HttpResponsePromise<core.Stream<TwelvelabsApi.StreamAnalyzeResponse>>;
|
|
77
77
|
private __analyzeStream;
|
|
78
78
|
/**
|
|
79
|
-
* This method
|
|
79
|
+
* This method analyzes your videos and returns the results directly in the response. It generates text based on your prompts and supports both Pegasus 1.2 and Pegasus 1.5 for general analysis (prompt-based text generation).
|
|
80
80
|
*
|
|
81
81
|
* <Accordion title="Input requirements">
|
|
82
82
|
* - Minimum duration: 4 seconds
|
|
@@ -88,50 +88,26 @@ export declare class TwelvelabsApiClient {
|
|
|
88
88
|
*
|
|
89
89
|
* **When to use this method**:
|
|
90
90
|
* - Analyze videos up to 1 hour
|
|
91
|
-
* - Retrieve immediate results without
|
|
92
|
-
* - Stream text fragments in real
|
|
91
|
+
* - Retrieve immediate results without polling for task completion
|
|
92
|
+
* - Stream text fragments in real time for immediate processing and feedback
|
|
93
93
|
*
|
|
94
94
|
* **Do not use this method for**:
|
|
95
95
|
* - Videos longer than 1 hour. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
96
|
-
* - Video segmentation. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with `model_name` set to `pegasus1.5` instead.
|
|
96
|
+
* - Video segmentation with custom segment definitions. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with the `model_name` parameter set to `pegasus1.5` instead.
|
|
97
97
|
*
|
|
98
|
-
* <Note title="
|
|
99
|
-
*
|
|
98
|
+
* <Note title="Note">
|
|
99
|
+
* This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page.
|
|
100
100
|
* </Note>
|
|
101
101
|
*
|
|
102
102
|
* @param {TwelvelabsApi.AnalyzeRequest} request
|
|
103
103
|
* @param {TwelvelabsApiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
104
|
*
|
|
105
105
|
* @throws {@link TwelvelabsApi.BadRequestError}
|
|
106
|
+
* @throws {@link TwelvelabsApi.NotFoundError}
|
|
106
107
|
* @throws {@link TwelvelabsApi.TooManyRequestsError}
|
|
107
108
|
*
|
|
108
109
|
* @example
|
|
109
|
-
* await client.analyze({
|
|
110
|
-
* videoId: "6298d673f1090f1100476d4c",
|
|
111
|
-
* prompt: "I want to generate a description for my video with the following format - Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
|
|
112
|
-
* temperature: 0.2,
|
|
113
|
-
* responseFormat: {
|
|
114
|
-
* type: "json_schema",
|
|
115
|
-
* jsonSchema: {
|
|
116
|
-
* "type": "object",
|
|
117
|
-
* "properties": {
|
|
118
|
-
* "title": {
|
|
119
|
-
* "type": "string"
|
|
120
|
-
* },
|
|
121
|
-
* "summary": {
|
|
122
|
-
* "type": "string"
|
|
123
|
-
* },
|
|
124
|
-
* "keywords": {
|
|
125
|
-
* "type": "array",
|
|
126
|
-
* "items": {
|
|
127
|
-
* "type": "string"
|
|
128
|
-
* }
|
|
129
|
-
* }
|
|
130
|
-
* }
|
|
131
|
-
* }
|
|
132
|
-
* },
|
|
133
|
-
* maxTokens: 2000
|
|
134
|
-
* })
|
|
110
|
+
* await client.analyze({})
|
|
135
111
|
*/
|
|
136
112
|
analyze(request: TwelvelabsApi.AnalyzeRequest, requestOptions?: TwelvelabsApiClient.RequestOptions): core.HttpResponsePromise<TwelvelabsApi.NonStreamAnalyzeResponse>;
|
|
137
113
|
private __analyze;
|
package/Client.js
CHANGED
|
@@ -100,7 +100,7 @@ class TwelvelabsApiClient {
|
|
|
100
100
|
return ((_a = this._analyzeAsync) !== null && _a !== void 0 ? _a : (this._analyzeAsync = new Client_8.AnalyzeAsync(this._options)));
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* This method
|
|
103
|
+
* This method analyzes your videos and returns the results directly in the response. It generates text based on your prompts and supports both Pegasus 1.2 and Pegasus 1.5 for general analysis (prompt-based text generation).
|
|
104
104
|
*
|
|
105
105
|
* <Accordion title="Input requirements">
|
|
106
106
|
* - Minimum duration: 4 seconds
|
|
@@ -112,15 +112,15 @@ class TwelvelabsApiClient {
|
|
|
112
112
|
*
|
|
113
113
|
* **When to use this method**:
|
|
114
114
|
* - Analyze videos up to 1 hour
|
|
115
|
-
* - Retrieve immediate results without
|
|
116
|
-
* - Stream text fragments in real
|
|
115
|
+
* - Retrieve immediate results without polling for task completion
|
|
116
|
+
* - Stream text fragments in real time for immediate processing and feedback
|
|
117
117
|
*
|
|
118
118
|
* **Do not use this method for**:
|
|
119
119
|
* - Videos longer than 1 hour. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
120
|
-
* - Video segmentation. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with `model_name` set to `pegasus1.5` instead.
|
|
120
|
+
* - Video segmentation with custom segment definitions. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with the `model_name` parameter set to `pegasus1.5` instead.
|
|
121
121
|
*
|
|
122
|
-
* <Note title="
|
|
123
|
-
*
|
|
122
|
+
* <Note title="Note">
|
|
123
|
+
* This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page.
|
|
124
124
|
* </Note>
|
|
125
125
|
*/
|
|
126
126
|
analyzeStream(request, requestOptions) {
|
|
@@ -132,12 +132,12 @@ class TwelvelabsApiClient {
|
|
|
132
132
|
const _response = yield core.fetcher({
|
|
133
133
|
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.TwelvelabsApiEnvironment.Default, "analyze"),
|
|
134
134
|
method: "POST",
|
|
135
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "twelvelabs-js", "X-Fern-SDK-Version": "1.2.
|
|
135
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "twelvelabs-js", "X-Fern-SDK-Version": "1.2.4", "User-Agent": "twelvelabs-js/1.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
136
136
|
contentType: "application/json",
|
|
137
137
|
requestType: "json",
|
|
138
138
|
body: Object.assign(Object.assign({}, serializers.AnalyzeStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), { stream: true }),
|
|
139
139
|
responseType: "sse",
|
|
140
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
140
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 600000,
|
|
141
141
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
142
142
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
143
143
|
});
|
|
@@ -166,6 +166,8 @@ class TwelvelabsApiClient {
|
|
|
166
166
|
switch (_response.error.statusCode) {
|
|
167
167
|
case 400:
|
|
168
168
|
throw new TwelvelabsApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
169
|
+
case 404:
|
|
170
|
+
throw new TwelvelabsApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
169
171
|
case 429:
|
|
170
172
|
throw new TwelvelabsApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
171
173
|
default:
|
|
@@ -194,7 +196,7 @@ class TwelvelabsApiClient {
|
|
|
194
196
|
});
|
|
195
197
|
}
|
|
196
198
|
/**
|
|
197
|
-
* This method
|
|
199
|
+
* This method analyzes your videos and returns the results directly in the response. It generates text based on your prompts and supports both Pegasus 1.2 and Pegasus 1.5 for general analysis (prompt-based text generation).
|
|
198
200
|
*
|
|
199
201
|
* <Accordion title="Input requirements">
|
|
200
202
|
* - Minimum duration: 4 seconds
|
|
@@ -206,50 +208,26 @@ class TwelvelabsApiClient {
|
|
|
206
208
|
*
|
|
207
209
|
* **When to use this method**:
|
|
208
210
|
* - Analyze videos up to 1 hour
|
|
209
|
-
* - Retrieve immediate results without
|
|
210
|
-
* - Stream text fragments in real
|
|
211
|
+
* - Retrieve immediate results without polling for task completion
|
|
212
|
+
* - Stream text fragments in real time for immediate processing and feedback
|
|
211
213
|
*
|
|
212
214
|
* **Do not use this method for**:
|
|
213
215
|
* - Videos longer than 1 hour. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
214
|
-
* - Video segmentation. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with `model_name` set to `pegasus1.5` instead.
|
|
216
|
+
* - Video segmentation with custom segment definitions. Use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint with the `model_name` parameter set to `pegasus1.5` instead.
|
|
215
217
|
*
|
|
216
|
-
* <Note title="
|
|
217
|
-
*
|
|
218
|
+
* <Note title="Note">
|
|
219
|
+
* This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page.
|
|
218
220
|
* </Note>
|
|
219
221
|
*
|
|
220
222
|
* @param {TwelvelabsApi.AnalyzeRequest} request
|
|
221
223
|
* @param {TwelvelabsApiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
222
224
|
*
|
|
223
225
|
* @throws {@link TwelvelabsApi.BadRequestError}
|
|
226
|
+
* @throws {@link TwelvelabsApi.NotFoundError}
|
|
224
227
|
* @throws {@link TwelvelabsApi.TooManyRequestsError}
|
|
225
228
|
*
|
|
226
229
|
* @example
|
|
227
|
-
* await client.analyze({
|
|
228
|
-
* videoId: "6298d673f1090f1100476d4c",
|
|
229
|
-
* prompt: "I want to generate a description for my video with the following format - Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
|
|
230
|
-
* temperature: 0.2,
|
|
231
|
-
* responseFormat: {
|
|
232
|
-
* type: "json_schema",
|
|
233
|
-
* jsonSchema: {
|
|
234
|
-
* "type": "object",
|
|
235
|
-
* "properties": {
|
|
236
|
-
* "title": {
|
|
237
|
-
* "type": "string"
|
|
238
|
-
* },
|
|
239
|
-
* "summary": {
|
|
240
|
-
* "type": "string"
|
|
241
|
-
* },
|
|
242
|
-
* "keywords": {
|
|
243
|
-
* "type": "array",
|
|
244
|
-
* "items": {
|
|
245
|
-
* "type": "string"
|
|
246
|
-
* }
|
|
247
|
-
* }
|
|
248
|
-
* }
|
|
249
|
-
* }
|
|
250
|
-
* },
|
|
251
|
-
* maxTokens: 2000
|
|
252
|
-
* })
|
|
230
|
+
* await client.analyze({})
|
|
253
231
|
*/
|
|
254
232
|
analyze(request, requestOptions) {
|
|
255
233
|
return core.HttpResponsePromise.fromPromise(this.__analyze(request, requestOptions));
|
|
@@ -260,11 +238,11 @@ class TwelvelabsApiClient {
|
|
|
260
238
|
const _response = yield core.fetcher({
|
|
261
239
|
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.TwelvelabsApiEnvironment.Default, "analyze"),
|
|
262
240
|
method: "POST",
|
|
263
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "twelvelabs-js", "X-Fern-SDK-Version": "1.2.
|
|
241
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "twelvelabs-js", "X-Fern-SDK-Version": "1.2.4", "User-Agent": "twelvelabs-js/1.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
264
242
|
contentType: "application/json",
|
|
265
243
|
requestType: "json",
|
|
266
244
|
body: Object.assign(Object.assign({}, serializers.AnalyzeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), { stream: false }),
|
|
267
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 :
|
|
245
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 600000,
|
|
268
246
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
269
247
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
270
248
|
});
|
|
@@ -283,6 +261,8 @@ class TwelvelabsApiClient {
|
|
|
283
261
|
switch (_response.error.statusCode) {
|
|
284
262
|
case 400:
|
|
285
263
|
throw new TwelvelabsApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
264
|
+
case 404:
|
|
265
|
+
throw new TwelvelabsApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
286
266
|
case 429:
|
|
287
267
|
throw new TwelvelabsApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
288
268
|
default:
|
|
@@ -4,43 +4,56 @@
|
|
|
4
4
|
import * as TwelvelabsApi from "../../index";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
|
-
* {
|
|
8
|
-
* videoId: "6298d673f1090f1100476d4c",
|
|
9
|
-
* prompt: "I want to generate a description for my video with the following format - Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
|
|
10
|
-
* temperature: 0.2,
|
|
11
|
-
* responseFormat: {
|
|
12
|
-
* type: "json_schema",
|
|
13
|
-
* jsonSchema: {
|
|
14
|
-
* "type": "object",
|
|
15
|
-
* "properties": {
|
|
16
|
-
* "title": {
|
|
17
|
-
* "type": "string"
|
|
18
|
-
* },
|
|
19
|
-
* "summary": {
|
|
20
|
-
* "type": "string"
|
|
21
|
-
* },
|
|
22
|
-
* "keywords": {
|
|
23
|
-
* "type": "array",
|
|
24
|
-
* "items": {
|
|
25
|
-
* "type": "string"
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* },
|
|
31
|
-
* maxTokens: 2000
|
|
32
|
-
* }
|
|
7
|
+
* {}
|
|
33
8
|
*/
|
|
34
9
|
export interface AnalyzeRequest {
|
|
35
10
|
/**
|
|
36
|
-
* The
|
|
11
|
+
* The video understanding model to use for analysis.
|
|
12
|
+
* - `pegasus1.2`: General analysis (prompt-based text generation).
|
|
13
|
+
* - `pegasus1.5`: General analysis (prompt-based text generation) with video clipping, structured prompts with reference images, extended token limits, and video segmentation (async only). Does not support `analysis_mode=time_based_metadata` or `response_format.type=segment_definitions` — use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
14
|
+
*
|
|
15
|
+
* **Default:** `pegasus1.2`
|
|
16
|
+
*/
|
|
17
|
+
modelName?: TwelvelabsApi.AnalyzeRequestModelName;
|
|
18
|
+
/**
|
|
19
|
+
* The unique identifier of the video to analyze. Use this parameter when the `model_name` parameter is `pegasus1.2`. Not supported with `pegasus1.5`.
|
|
37
20
|
*
|
|
38
21
|
* <Info> This parameter will be deprecated and removed in a future version. Use the [`video`](/v1.3/api-reference/analyze-videos/sync-analysis#request.body.video) parameter instead.</Info>
|
|
39
22
|
*/
|
|
40
23
|
videoId?: string;
|
|
41
24
|
video?: TwelvelabsApi.VideoContext;
|
|
42
|
-
prompt
|
|
25
|
+
/** A text prompt that guides the model on the desired format or content. Works with both Pegasus 1.2 and Pegasus 1.5. To include reference images in your prompt, use the `prompt_v2` parameter instead (Pegasus 1.5 only). Mutually exclusive with the `prompt_v2` parameter. */
|
|
26
|
+
prompt?: TwelvelabsApi.AnalyzeTextPrompt;
|
|
27
|
+
/** A structured prompt with `<@name>` placeholders for referencing images. Requires the `model_name` parameter set to `pegasus1.5`. Mutually exclusive with the `prompt` parameter. */
|
|
28
|
+
promptV2?: TwelvelabsApi.AnalyzePromptV2;
|
|
43
29
|
temperature?: TwelvelabsApi.AnalyzeTemperature;
|
|
30
|
+
/** Specifies the format of the response. When you omit this parameter, the platform returns unstructured text. Only the `json_schema` type is supported for synchronous analysis. */
|
|
44
31
|
responseFormat?: TwelvelabsApi.SyncResponseFormat;
|
|
45
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The maximum number of tokens to generate. The allowed range depends on the model:
|
|
34
|
+
*
|
|
35
|
+
* | Model | Min | Max | Default |
|
|
36
|
+
* |-------|-----|-----|---------|
|
|
37
|
+
* | Pegasus 1.2 | 1 | 4,096 | 4,096 |
|
|
38
|
+
* | Pegasus 1.5 | 512 | 65,536 | 4,096 |
|
|
39
|
+
*/
|
|
40
|
+
maxTokens?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Start of the analysis window, in seconds. Use with `end_time` to analyze only a portion of the video. Requires `model_name` set to `pegasus1.5`.
|
|
43
|
+
*
|
|
44
|
+
* <Note title="Notes">
|
|
45
|
+
* - If omitted, defaults to `0`.
|
|
46
|
+
* - Must be less than `end_time` and less than the video duration. The clip (`end_time - start_time`) must be at least `4` seconds.
|
|
47
|
+
* </Note>
|
|
48
|
+
*/
|
|
49
|
+
startTime?: number;
|
|
50
|
+
/**
|
|
51
|
+
* End of the analysis window, in seconds. Use with `start_time` to analyze only a portion of the video. Requires `model_name` set to `pegasus1.5`.
|
|
52
|
+
*
|
|
53
|
+
* <Note title="Notes">
|
|
54
|
+
* - If omitted, defaults to the video duration.
|
|
55
|
+
* - Must be greater than `start_time` and less than or equal to the video duration. The clip (`end_time - start_time`) must be at least `4` seconds.
|
|
56
|
+
* </Note>
|
|
57
|
+
*/
|
|
58
|
+
endTime?: number;
|
|
46
59
|
}
|
|
@@ -4,43 +4,56 @@
|
|
|
4
4
|
import * as TwelvelabsApi from "../../index";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
|
-
* {
|
|
8
|
-
* videoId: "6298d673f1090f1100476d4c",
|
|
9
|
-
* prompt: "I want to generate a description for my video with the following format - Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.",
|
|
10
|
-
* temperature: 0.2,
|
|
11
|
-
* responseFormat: {
|
|
12
|
-
* type: "json_schema",
|
|
13
|
-
* jsonSchema: {
|
|
14
|
-
* "type": "object",
|
|
15
|
-
* "properties": {
|
|
16
|
-
* "title": {
|
|
17
|
-
* "type": "string"
|
|
18
|
-
* },
|
|
19
|
-
* "summary": {
|
|
20
|
-
* "type": "string"
|
|
21
|
-
* },
|
|
22
|
-
* "keywords": {
|
|
23
|
-
* "type": "array",
|
|
24
|
-
* "items": {
|
|
25
|
-
* "type": "string"
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* },
|
|
31
|
-
* maxTokens: 2000
|
|
32
|
-
* }
|
|
7
|
+
* {}
|
|
33
8
|
*/
|
|
34
9
|
export interface AnalyzeStreamRequest {
|
|
35
10
|
/**
|
|
36
|
-
* The
|
|
11
|
+
* The video understanding model to use for analysis.
|
|
12
|
+
* - `pegasus1.2`: General analysis (prompt-based text generation).
|
|
13
|
+
* - `pegasus1.5`: General analysis (prompt-based text generation) with video clipping, structured prompts with reference images, extended token limits, and video segmentation (async only). Does not support `analysis_mode=time_based_metadata` or `response_format.type=segment_definitions` — use the [`POST`](/v1.3/api-reference/analyze-videos/create-async-analysis-task) method of the `/analyze/tasks` endpoint instead.
|
|
14
|
+
*
|
|
15
|
+
* **Default:** `pegasus1.2`
|
|
16
|
+
*/
|
|
17
|
+
modelName?: TwelvelabsApi.AnalyzeStreamRequestModelName;
|
|
18
|
+
/**
|
|
19
|
+
* The unique identifier of the video to analyze. Use this parameter when the `model_name` parameter is `pegasus1.2`. Not supported with `pegasus1.5`.
|
|
37
20
|
*
|
|
38
21
|
* <Info> This parameter will be deprecated and removed in a future version. Use the [`video`](/v1.3/api-reference/analyze-videos/sync-analysis#request.body.video) parameter instead.</Info>
|
|
39
22
|
*/
|
|
40
23
|
videoId?: string;
|
|
41
24
|
video?: TwelvelabsApi.VideoContext;
|
|
42
|
-
prompt
|
|
25
|
+
/** A text prompt that guides the model on the desired format or content. Works with both Pegasus 1.2 and Pegasus 1.5. To include reference images in your prompt, use the `prompt_v2` parameter instead (Pegasus 1.5 only). Mutually exclusive with the `prompt_v2` parameter. */
|
|
26
|
+
prompt?: TwelvelabsApi.AnalyzeTextPrompt;
|
|
27
|
+
/** A structured prompt with `<@name>` placeholders for referencing images. Requires the `model_name` parameter set to `pegasus1.5`. Mutually exclusive with the `prompt` parameter. */
|
|
28
|
+
promptV2?: TwelvelabsApi.AnalyzePromptV2;
|
|
43
29
|
temperature?: TwelvelabsApi.AnalyzeTemperature;
|
|
30
|
+
/** Specifies the format of the response. When you omit this parameter, the platform returns unstructured text. Only the `json_schema` type is supported for synchronous analysis. */
|
|
44
31
|
responseFormat?: TwelvelabsApi.SyncResponseFormat;
|
|
45
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The maximum number of tokens to generate. The allowed range depends on the model:
|
|
34
|
+
*
|
|
35
|
+
* | Model | Min | Max | Default |
|
|
36
|
+
* |-------|-----|-----|---------|
|
|
37
|
+
* | Pegasus 1.2 | 1 | 4,096 | 4,096 |
|
|
38
|
+
* | Pegasus 1.5 | 512 | 65,536 | 4,096 |
|
|
39
|
+
*/
|
|
40
|
+
maxTokens?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Start of the analysis window, in seconds. Use with `end_time` to analyze only a portion of the video. Requires `model_name` set to `pegasus1.5`.
|
|
43
|
+
*
|
|
44
|
+
* <Note title="Notes">
|
|
45
|
+
* - If omitted, defaults to `0`.
|
|
46
|
+
* - Must be less than `end_time` and less than the video duration. The clip (`end_time - start_time`) must be at least `4` seconds.
|
|
47
|
+
* </Note>
|
|
48
|
+
*/
|
|
49
|
+
startTime?: number;
|
|
50
|
+
/**
|
|
51
|
+
* End of the analysis window, in seconds. Use with `start_time` to analyze only a portion of the video. Requires `model_name` set to `pegasus1.5`.
|
|
52
|
+
*
|
|
53
|
+
* <Note title="Notes">
|
|
54
|
+
* - If omitted, defaults to the video duration.
|
|
55
|
+
* - Must be greater than `start_time` and less than or equal to the video duration. The clip (`end_time - start_time`) must be at least `4` seconds.
|
|
56
|
+
* </Note>
|
|
57
|
+
*/
|
|
58
|
+
endTime?: number;
|
|
46
59
|
}
|
|
@@ -40,13 +40,14 @@ export declare class Tasks {
|
|
|
40
40
|
* status: "queued",
|
|
41
41
|
* videoUrl: "https://example.com/video.mp4",
|
|
42
42
|
* assetId: "69abc123def456789012abcd",
|
|
43
|
-
*
|
|
43
|
+
* videoId: "6298d673f1090f1100476d4c",
|
|
44
|
+
* analysisMode: "general"
|
|
44
45
|
* })
|
|
45
46
|
*/
|
|
46
47
|
list(request?: TwelvelabsApi.analyzeAsync.TasksListRequest, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<TwelvelabsApi.analyzeAsync.TasksListResponse>;
|
|
47
48
|
private __list;
|
|
48
49
|
/**
|
|
49
|
-
* This method asynchronously analyzes your videos. It supports two modes: general analysis (prompt-based text generation) with
|
|
50
|
+
* This method asynchronously analyzes your videos. It supports two analysis modes: general analysis (prompt-based text generation) and video segmentation with custom segment definitions. Video segmentation requires Pegasus 1.5.
|
|
50
51
|
*
|
|
51
52
|
* <Accordion title="Input requirements">
|
|
52
53
|
* - Minimum duration: 4 seconds
|
|
@@ -57,8 +58,8 @@ export declare class Tasks {
|
|
|
57
58
|
* </Accordion>
|
|
58
59
|
*
|
|
59
60
|
* **When to use this method**:
|
|
60
|
-
* - Generate custom text from your video using a prompt (
|
|
61
|
-
* - Extract timestamped metadata with custom
|
|
61
|
+
* - Generate custom text from your video using a prompt (general analysis)
|
|
62
|
+
* - Extract timestamped metadata with custom segment definitions from your video (Pegasus 1.5 only)
|
|
62
63
|
* - Analyze videos longer than 1 hour
|
|
63
64
|
* - Process videos asynchronously without blocking your application
|
|
64
65
|
*
|
|
@@ -83,6 +84,7 @@ export declare class Tasks {
|
|
|
83
84
|
*
|
|
84
85
|
* @example
|
|
85
86
|
* await client.analyzeAsync.tasks.create({
|
|
87
|
+
* customId: "prod-segment-analysis-42",
|
|
86
88
|
* video: {
|
|
87
89
|
* type: "url",
|
|
88
90
|
* url: "https://example.com/video.mp4"
|
|
@@ -123,6 +125,61 @@ export declare class Tasks {
|
|
|
123
125
|
* minSegmentDuration: 5,
|
|
124
126
|
* maxSegmentDuration: 30
|
|
125
127
|
* })
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.analyzeAsync.tasks.create({
|
|
131
|
+
* modelName: "pegasus1.5",
|
|
132
|
+
* video: {
|
|
133
|
+
* type: "url",
|
|
134
|
+
* url: "https://example.com/video.mp4"
|
|
135
|
+
* },
|
|
136
|
+
* prompt: "Summarize the key events in this clip.",
|
|
137
|
+
* maxTokens: 4096,
|
|
138
|
+
* startTime: 10,
|
|
139
|
+
* endTime: 60
|
|
140
|
+
* })
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* await client.analyzeAsync.tasks.create({
|
|
144
|
+
* modelName: "pegasus1.5",
|
|
145
|
+
* video: {
|
|
146
|
+
* type: "url",
|
|
147
|
+
* url: "https://example.com/video.mp4"
|
|
148
|
+
* },
|
|
149
|
+
* analysisMode: "time_based_metadata",
|
|
150
|
+
* responseFormat: {
|
|
151
|
+
* type: "segment_definitions",
|
|
152
|
+
* segmentDefinitions: [{
|
|
153
|
+
* id: "scenes",
|
|
154
|
+
* description: "Scene changes.",
|
|
155
|
+
* timeRanges: [{
|
|
156
|
+
* startTime: 0,
|
|
157
|
+
* endTime: 4
|
|
158
|
+
* }, {
|
|
159
|
+
* startTime: 10,
|
|
160
|
+
* endTime: 14
|
|
161
|
+
* }]
|
|
162
|
+
* }]
|
|
163
|
+
* }
|
|
164
|
+
* })
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* await client.analyzeAsync.tasks.create({
|
|
168
|
+
* modelName: "pegasus1.5",
|
|
169
|
+
* video: {
|
|
170
|
+
* type: "url",
|
|
171
|
+
* url: "https://example.com/video.mp4"
|
|
172
|
+
* },
|
|
173
|
+
* promptV2: {
|
|
174
|
+
* inputText: "Is there a <@tiger-1> in the video?",
|
|
175
|
+
* mediaSources: [{
|
|
176
|
+
* name: "tiger-1",
|
|
177
|
+
* mediaType: "image",
|
|
178
|
+
* url: "https://example.com/tiger.jpg"
|
|
179
|
+
* }]
|
|
180
|
+
* },
|
|
181
|
+
* maxTokens: 4096
|
|
182
|
+
* })
|
|
126
183
|
*/
|
|
127
184
|
create(request: TwelvelabsApi.analyzeAsync.CreateAsyncAnalyzeRequest, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<TwelvelabsApi.CreateAnalyzeTaskResponse>;
|
|
128
185
|
private __create;
|