Skip to content

Commit

Permalink
Update Summary endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo authored Nov 6, 2024
1 parent 928b1fd commit 0d3a17d
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [2.6.8] - 2024-11-06
- AI summary updates

## [2.6.7] - 2024-11-04
- Analytics updates (ccv, views, ...)

Expand Down
4 changes: 2 additions & 2 deletions docs/api/SummariesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All URIs are relative to *https://ws.api.video*
## **`create()` - Generate video summary**


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

### Parameters

Expand All @@ -37,7 +37,7 @@ Promise<[**Summary**](../model/Summary.md)>.
## **`update()` - Update summary details**


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

### Parameters

Expand Down
10 changes: 10 additions & 0 deletions docs/model/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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]
**attributes** | [**Array&lt;SummaryCreationPayloadAttributesEnum&gt;**](#Array&lt;SummaryCreationPayloadAttributesEnum&gt;) | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional]



Expand All @@ -18,3 +19,12 @@ Auto | &#39;auto&#39;



## Enum: Array&lt;SummaryCreationPayloadAttributesEnum&gt;

Name | Value
---- | -----
Abstract | &#39;abstract&#39;
Takeaways | &#39;takeaways&#39;



1 change: 0 additions & 1 deletion docs/model/SummarySource.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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]

Expand Down
1 change: 0 additions & 1 deletion docs/model/SummaryUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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]

Expand Down
10 changes: 10 additions & 0 deletions docs/model/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Name | Type | Description | Notes
**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]
**transcriptSummaryAttributes** | [**Array&lt;VideoCreationPayloadTranscriptSummaryAttributesEnum&gt;**](#Array&lt;VideoCreationPayloadTranscriptSummaryAttributesEnum&gt;) | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional]



Expand Down Expand Up @@ -62,3 +63,12 @@ Zh | &#39;zh&#39;



## Enum: Array&lt;VideoCreationPayloadTranscriptSummaryAttributesEnum&gt;

Name | Value
---- | -----
Abstract | &#39;abstract&#39;
Takeaways | &#39;takeaways&#39;



10 changes: 10 additions & 0 deletions docs/model/VideoUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Name | Type | Description | Notes
**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]
**transcriptSummaryAttributes** | [**Array&lt;VideoUpdatePayloadTranscriptSummaryAttributesEnum&gt;**](#Array&lt;VideoUpdatePayloadTranscriptSummaryAttributesEnum&gt;) | Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes. | [optional]



Expand Down Expand Up @@ -59,3 +60,12 @@ Zh | &#39;zh&#39;



## Enum: Array&lt;VideoUpdatePayloadTranscriptSummaryAttributesEnum&gt;

Name | Value
---- | -----
Abstract | &#39;abstract&#39;
Takeaways | &#39;takeaways&#39;



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api.video/nodejs-client",
"version": "2.6.7",
"version": "2.6.8",
"description": "api.video nodejs API client",
"keywords": [
"api.video",
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class HttpClient {
this.chunkSize = params.chunkSize;
this.headers = new AxiosHeaders({
Accept: 'application/json, */*;q=0.8',
'AV-Origin-Client': 'nodejs:2.6.7',
'AV-Origin-Client': 'nodejs:2.6.8',
Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '',
...(params.applicationName && params.applicationVersion
? {
Expand Down
3 changes: 3 additions & 0 deletions src/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ const enumsMap: Set<string> = new Set<string>([
'SummaryOriginEnum',
'SummarySourceStatusEnum',
'SummaryCreationPayloadOriginEnum',
'SummaryCreationPayloadAttributesEnum',
'VideoLanguageOriginEnum',
'VideoCreationPayloadLanguageEnum',
'VideoCreationPayloadTranscriptSummaryAttributesEnum',
'VideoStatusIngestStatusEnum',
'VideoUpdatePayloadLanguageEnum',
'VideoUpdatePayloadTranscriptSummaryAttributesEnum',
]);

const typeMap: { [index: string]: any } = {
Expand Down
8 changes: 4 additions & 4 deletions src/api/SummariesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class SummariesApi {
}

/**
* Generate a title, abstract, and key takeaways for a video.
* Generate an abstract and key takeaways for a video.
* Generate video summary
* @param summaryCreationPayload
*/
Expand All @@ -42,7 +42,7 @@ export default class SummariesApi {
}

/**
* Generate a title, abstract, and key takeaways for a video.
* Generate an abstract and key takeaways for a video.
* Generate video summary
* @param summaryCreationPayload
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class SummariesApi {
}

/**
* Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`.
* Update details for a summary.
* Update summary details
* @param summaryId The unique identifier of the summary source you want to update.
* @param summaryUpdatePayload
Expand All @@ -110,7 +110,7 @@ export default class SummariesApi {
}

/**
* Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`.
* Update details for a summary.
* Update summary details
* @param summaryId The unique identifier of the summary source you want to update.
* @param summaryUpdatePayload
Expand Down
11 changes: 11 additions & 0 deletions src/model/SummaryCreationPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default class SummaryCreationPayload {
* Use this parameter to define how the API generates the summary. The only allowed value is `auto`, 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, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation.
*/
'origin'?: SummaryCreationPayloadOriginEnum;
/**
* Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes.
*/
'attributes'?: Array<SummaryCreationPayloadAttributesEnum>;

static readonly discriminator?: string = undefined;

Expand All @@ -36,6 +40,12 @@ export default class SummaryCreationPayload {
type: 'SummaryCreationPayloadOriginEnum',
format: '',
},
{
name: 'attributes',
baseName: 'attributes',
type: 'Array<SummaryCreationPayloadAttributesEnum>',
format: '',
},
];

static getAttributeTypeMap(): Array<AttributeType> {
Expand All @@ -44,3 +54,4 @@ export default class SummaryCreationPayload {
}

export type SummaryCreationPayloadOriginEnum = 'auto';
export type SummaryCreationPayloadAttributesEnum = 'abstract' | 'takeaways';
10 changes: 0 additions & 10 deletions src/model/SummarySource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import AttributeType from './AttributeType.js';

export default class SummarySource {
/**
* A video title, based on the contents of the video.
*/
'title'?: string;
/**
* A short outline of the contents of the video. The length of an `abstract` depends on the amount of content in a video that can be transcribed. The API condenses the contents into minimum 20, maximum 300 words.
*/
Expand All @@ -28,12 +24,6 @@ export default class SummarySource {
static readonly discriminator?: string = undefined;

static readonly attributeTypeMap: Array<AttributeType> = [
{
name: 'title',
baseName: 'title',
type: 'string',
format: '',
},
{
name: '_abstract',
baseName: 'abstract',
Expand Down
10 changes: 0 additions & 10 deletions src/model/SummaryUpdatePayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import AttributeType from './AttributeType.js';

export default class SummaryUpdatePayload {
/**
* A video title, based on the contents of the video.
*/
'title'?: string;
/**
* A short outline of the contents of the video.
*/
Expand All @@ -28,12 +24,6 @@ export default class SummaryUpdatePayload {
static readonly discriminator?: string = undefined;

static readonly attributeTypeMap: Array<AttributeType> = [
{
name: 'title',
baseName: 'title',
type: 'string',
format: '',
},
{
name: '_abstract',
baseName: 'abstract',
Expand Down
13 changes: 13 additions & 0 deletions src/model/VideoCreationPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default class VideoCreationPayload {
* Use this parameter to enable summarization. We recommend using this parameter together with `transcript: true`. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` 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.
*/
'transcriptSummary'?: boolean;
/**
* Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes.
*/
'transcriptSummaryAttributes'?: Array<VideoCreationPayloadTranscriptSummaryAttributesEnum>;

static readonly discriminator?: string = undefined;

Expand Down Expand Up @@ -153,6 +157,12 @@ export default class VideoCreationPayload {
type: 'boolean',
format: '',
},
{
name: 'transcriptSummaryAttributes',
baseName: 'transcriptSummaryAttributes',
type: 'Array<VideoCreationPayloadTranscriptSummaryAttributesEnum>',
format: '',
},
];

static getAttributeTypeMap(): Array<AttributeType> {
Expand Down Expand Up @@ -194,3 +204,6 @@ export type VideoCreationPayloadLanguageEnum =
| 'ur'
| 'vi'
| 'zh';
export type VideoCreationPayloadTranscriptSummaryAttributesEnum =
| 'abstract'
| 'takeaways';
13 changes: 13 additions & 0 deletions src/model/VideoUpdatePayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default class VideoUpdatePayload {
* Use this parameter to enable summarization. - When `true`, the API generates a summary for the video, based on the transcription. - The default value is `false`. - If you define a video language using the `language` 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.
*/
'transcriptSummary'?: boolean;
/**
* Use this parameter to define the elements of a summary that you want to generate. If you do not define this parameter, the API generates a full summary with all attributes.
*/
'transcriptSummaryAttributes'?: Array<VideoUpdatePayloadTranscriptSummaryAttributesEnum>;

static readonly discriminator?: string = undefined;

Expand Down Expand Up @@ -127,6 +131,12 @@ export default class VideoUpdatePayload {
type: 'boolean',
format: '',
},
{
name: 'transcriptSummaryAttributes',
baseName: 'transcriptSummaryAttributes',
type: 'Array<VideoUpdatePayloadTranscriptSummaryAttributesEnum>',
format: '',
},
];

static getAttributeTypeMap(): Array<AttributeType> {
Expand Down Expand Up @@ -168,3 +178,6 @@ export type VideoUpdatePayloadLanguageEnum =
| 'ur'
| 'vi'
| 'zh';
export type VideoUpdatePayloadTranscriptSummaryAttributesEnum =
| 'abstract'
| 'takeaways';

0 comments on commit 0d3a17d

Please sign in to comment.