Skip to content

Commit

Permalink
Add summary feature
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo authored Oct 21, 2024
1 parent fb634b2 commit 5f1c809
Show file tree
Hide file tree
Showing 30 changed files with 1,109 additions and 4 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [ChaptersApi](#chaptersapi)
- [LiveStreamsApi](#livestreamsapi)
- [PlayerThemesApi](#playerthemesapi)
- [SummariesApi](#summariesapi)
- [TagsApi](#tagsapi)
- [UploadTokensApi](#uploadtokensapi)
- [VideosApi](#videosapi)
Expand Down Expand Up @@ -162,6 +163,17 @@ Method | Description | HTTP request
[**deleteLogo()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/PlayerThemesApi.md#deleteLogo) | Delete logo | **DELETE** `/players/{playerId}/logo`


#### SummariesApi

Method | Description | HTTP request
------------- | ------------- | -------------
[**create()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#create) | Generate video summary | **POST** `/summaries`
[**update()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#update) | Update summary details | **PATCH** `/summaries/{summaryId}/source`
[**delete()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#delete) | Delete video summary | **DELETE** `/summaries/{summaryId}`
[**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#list) | List summaries | **GET** `/summaries`
[**getSummarySource()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/SummariesApi.md#getSummarySource) | Get summary details | **GET** `/summaries/{summaryId}/source`


#### TagsApi

Method | Description | HTTP request
Expand Down Expand Up @@ -242,6 +254,7 @@ Method | Description | HTTP request
- [CaptionsUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/CaptionsUpdatePayload.md)
- [Chapter](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Chapter.md)
- [ChaptersListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ChaptersListResponse.md)
- [ConflictError](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ConflictError.md)
- [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/DiscardedVideoUpdatePayload.md)
- [FilterBy](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy.md)
- [FilterBy1](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy1.md)
Expand Down Expand Up @@ -269,6 +282,11 @@ Method | Description | HTTP request
- [RefreshTokenPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RefreshTokenPayload.md)
- [RestreamsRequestObject](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RestreamsRequestObject.md)
- [RestreamsResponseObject](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/RestreamsResponseObject.md)
- [SummariesListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummariesListResponse.md)
- [Summary](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Summary.md)
- [SummaryCreationPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummaryCreationPayload.md)
- [SummarySource](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummarySource.md)
- [SummaryUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/SummaryUpdatePayload.md)
- [TokenCreationPayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/TooManyRequests.md)
Expand Down
127 changes: 127 additions & 0 deletions docs/api/SummariesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# SummariesApi

All URIs are relative to *https://ws.api.video*

| Method | Description | HTTP request |
| ------------- | ------------- | ------------- |
| [**create()**](SummariesApi.md#create) | Generate video summary | **POST** /summaries |
| [**update()**](SummariesApi.md#update) | Update summary details | **PATCH** /summaries/{summaryId}/source |
| [**delete()**](SummariesApi.md#delete) | Delete video summary | **DELETE** /summaries/{summaryId} |
| [**list()**](SummariesApi.md#list) | List summaries | **GET** /summaries |
| [**getSummarySource()**](SummariesApi.md#getSummarySource) | Get summary details | **GET** /summaries/{summaryId}/source |


<a name="create"></a>
## **`create()` - Generate video summary**


Generate a title, abstract, and key takeaways for a video.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryCreationPayload** | [**SummaryCreationPayload**](../model/SummaryCreationPayload.md)| **yes**| |


### Return type

Promise<[**Summary**](../model/Summary.md)>.




---

<a name="update"></a>
## **`update()` - Update summary details**


Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary source you want to update. |
| **summaryUpdatePayload** | [**SummaryUpdatePayload**](../model/SummaryUpdatePayload.md)| **yes**| |


### Return type

Promise<[**SummarySource**](../model/SummarySource.md)>.




---

<a name="delete"></a>
## **`delete()` - Delete video summary**


Delete a summary tied to a video.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary you want to delete. |


### Return type

Promise<[**void**](../model/.md)>.




---

<a name="list"></a>
## **`list()` - List summaries**


List all summarries for your videos in a project.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **sortBy** | **string**| no| Allowed: createdAt. You can search by the time watermark were created at. |
| **sortOrder** | **string**| no| Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. |
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |


### Return type

Promise<[**SummariesListResponse**](../model/SummariesListResponse.md)>.




---

<a name="getSummarySource"></a>
## **`getSummarySource()` - Get summary details**


Get all details for a summary.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **summaryId** | **string**| **yes**| The unique identifier of the summary source you want to retrieve. |


### Return type

Promise<[**SummarySource**](../model/SummarySource.md)>.




---

15 changes: 15 additions & 0 deletions docs/model/ConflictError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# ConflictError

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | A link to the error documentation. | [optional]
**title** | **string** | A description of the error that occurred. | [optional]
**name** | **string** | The name of the parameter that caused the error. | [optional]
**status** | **number** | The HTTP status code. | [optional]
**detail** | **string** | A solution for the error. | [optional]



8 changes: 4 additions & 4 deletions docs/model/NotFound.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | | [optional]
**title** | **string** | | [optional]
**name** | **string** | | [optional]
**status** | **number** | | [optional]
**type** | **string** | A link to the error documentation. | [optional]
**title** | **string** | A description of the error that occurred. | [optional]
**name** | **string** | The name of the parameter that caused the error. | [optional]
**status** | **number** | The HTTP status code. | [optional]



12 changes: 12 additions & 0 deletions docs/model/SummariesListResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# SummariesListResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**Array&lt;Summary&gt;**](Summary.md) | An array of summary objects. |
**pagination** | [**Pagination**](Pagination.md) | |



37 changes: 37 additions & 0 deletions docs/model/Summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Summary

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**summaryId** | **string** | The unique identifier of the summary object. | [optional]
**createdAt** | **Date** | Returns the date and time when the summary was created in ATOM date-time format. | [optional]
**updatedAt** | **Date** | Returns the date and time when the summary was last updated in ATOM date-time format. | [optional]
**videoId** | **string** | The unique identifier of the video object. | [optional]
**origin** | [**SummaryOriginEnum**](#SummaryOriginEnum) | Returns the origin of how the summary was created. - &#x60;api&#x60; means that no summary was generated automatically. You can add summary manually using the &#x60;PATCH /summaries/{summaryId}/source&#x60; endpoint operation. Until this happens, &#x60;sourceStatus&#x60; returns &#x60;missing&#x60;. - &#x60;auto&#x60; means that the API generated the summary automatically. | [optional]
**sourceStatus** | [**SummarySourceStatusEnum**](#SummarySourceStatusEnum) | Returns the current status of summary generation. &#x60;missing&#x60;: the input for a summary is not present. &#x60;waiting&#x60; : the input video is being processed and a summary will be generated. &#x60;failed&#x60;: a technical issue prevented summary generation. &#x60;completed&#x60;: the summary is generated. &#x60;unprocessable&#x60;: the API rules the source video to be unsuitable for summary generation. An example for this is an input video that has no audio. | [optional]



## Enum: SummaryOriginEnum

Name | Value
---- | -----
Api | &#39;api&#39;
Auto | &#39;auto&#39;



## Enum: SummarySourceStatusEnum

Name | Value
---- | -----
Missing | &#39;missing&#39;
Waiting | &#39;waiting&#39;
Failed | &#39;failed&#39;
Completed | &#39;completed&#39;
Unprocessable | &#39;unprocessable&#39;



20 changes: 20 additions & 0 deletions docs/model/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# SummaryCreationPayload

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**videoId** | **string** | Create a summary of a video using the video ID. |
**origin** | [**SummaryCreationPayloadOriginEnum**](#SummaryCreationPayloadOriginEnum) | Use this parameter to define how the API generates the summary. The only allowed value is &#x60;auto&#x60;, which means that the API generates a summary automatically. If you do not set this parameter, **the API will not generate a summary automatically**. In this case, &#x60;sourceStatus&#x60; will return &#x60;missing&#x60;, and you have to manually add a summary using the &#x60;PATCH /summaries/{summaryId}/source&#x60; endpoint operation. | [optional]



## Enum: SummaryCreationPayloadOriginEnum

Name | Value
---- | -----
Auto | &#39;auto&#39;



13 changes: 13 additions & 0 deletions docs/model/SummarySource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# SummarySource

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **string** | A video title, based on the contents of the video. | [optional]
**_abstract** | **string** | A short outline of the contents of the video. The length of an &#x60;abstract&#x60; depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words. | [optional]
**takeaways** | **Array&lt;string&gt;** | A list of 3 key points from the video, in chronological order. | [optional]



13 changes: 13 additions & 0 deletions docs/model/SummaryUpdatePayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# SummaryUpdatePayload

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **string** | A video title, based on the contents of the video. | [optional]
**_abstract** | **string** | A short outline of the contents of the video. | [optional]
**takeaways** | **Array&lt;string&gt;** | A list of 3 key points from the video, in chronological order. | [optional]



1 change: 1 addition & 0 deletions docs/model/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]
**language** | [**VideoCreationPayloadLanguageEnum**](#VideoCreationPayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. &#x60;language&#x60; is a permanent attribute of the video. You can update it to another language using the [&#x60;PATCH /videos/{videoId}&#x60;](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
**transcript** | **boolean** | Use this parameter to enable transcription. - When &#x60;true&#x60;, the API generates a transcript for the video. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
**transcriptSummary** | **boolean** | Use this parameter to enable summarization. We recommend using this parameter together with &#x60;transcript: true&#x60;. - When &#x60;true&#x60;, the API generates a summary for the video, based on the transcription. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional]



Expand Down
1 change: 1 addition & 0 deletions docs/model/VideoUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional]
**language** | [**VideoUpdatePayloadLanguageEnum**](#VideoUpdatePayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. &#x60;language&#x60; is a permanent attribute of the video. You can update it to another language using the [&#x60;PATCH /videos/{videoId}&#x60;](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
**transcript** | **boolean** | Use this parameter to enable transcription. - When &#x60;true&#x60;, the API generates a transcript for the video. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
**transcriptSummary** | **boolean** | Use this parameter to enable summarization. - When &#x60;true&#x60;, the API generates a summary for the video, based on the transcription. - The default value is &#x60;false&#x60;. - If you define a video language using the &#x60;language&#x60; parameter, the API uses that language to summarize the video. If you do not define a language, the API detects it based on the video. | [optional]



Expand Down
15 changes: 15 additions & 0 deletions src/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import CaptionsListResponse from './model/CaptionsListResponse';
import CaptionsUpdatePayload from './model/CaptionsUpdatePayload';
import Chapter from './model/Chapter';
import ChaptersListResponse from './model/ChaptersListResponse';
import ConflictError from './model/ConflictError';
import DiscardedVideoUpdatePayload from './model/DiscardedVideoUpdatePayload';
import FilterBy from './model/FilterBy';
import FilterBy1 from './model/FilterBy1';
Expand Down Expand Up @@ -59,6 +60,11 @@ import Quality from './model/Quality';
import RefreshTokenPayload from './model/RefreshTokenPayload';
import RestreamsRequestObject from './model/RestreamsRequestObject';
import RestreamsResponseObject from './model/RestreamsResponseObject';
import SummariesListResponse from './model/SummariesListResponse';
import Summary from './model/Summary';
import SummaryCreationPayload from './model/SummaryCreationPayload';
import SummarySource from './model/SummarySource';
import SummaryUpdatePayload from './model/SummaryUpdatePayload';
import TokenCreationPayload from './model/TokenCreationPayload';
import TokenListResponse from './model/TokenListResponse';
import TooManyRequests from './model/TooManyRequests';
Expand Down Expand Up @@ -119,6 +125,9 @@ const enumsMap: Set<string> = new Set<string>([
'QualityTypeEnum',
'QualityQualityEnum',
'QualityStatusEnum',
'SummaryOriginEnum',
'SummarySourceStatusEnum',
'SummaryCreationPayloadOriginEnum',
'VideoLanguageOriginEnum',
'VideoCreationPayloadLanguageEnum',
'VideoStatusIngestStatusEnum',
Expand Down Expand Up @@ -152,6 +161,7 @@ const typeMap: { [index: string]: any } = {
CaptionsUpdatePayload: CaptionsUpdatePayload,
Chapter: Chapter,
ChaptersListResponse: ChaptersListResponse,
ConflictError: ConflictError,
DiscardedVideoUpdatePayload: DiscardedVideoUpdatePayload,
FilterBy: FilterBy,
FilterBy1: FilterBy1,
Expand Down Expand Up @@ -179,6 +189,11 @@ const typeMap: { [index: string]: any } = {
RefreshTokenPayload: RefreshTokenPayload,
RestreamsRequestObject: RestreamsRequestObject,
RestreamsResponseObject: RestreamsResponseObject,
SummariesListResponse: SummariesListResponse,
Summary: Summary,
SummaryCreationPayload: SummaryCreationPayload,
SummarySource: SummarySource,
SummaryUpdatePayload: SummaryUpdatePayload,
TokenCreationPayload: TokenCreationPayload,
TokenListResponse: TokenListResponse,
TooManyRequests: TooManyRequests,
Expand Down
Loading

0 comments on commit 5f1c809

Please sign in to comment.