From 0d3a17ddef31453584f2e19b6847f8f61cc63a99 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Wed, 6 Nov 2024 08:50:42 +0000 Subject: [PATCH] Update Summary endpoints --- CHANGELOG.md | 3 +++ docs/api/SummariesApi.md | 4 ++-- docs/model/SummaryCreationPayload.md | 10 ++++++++++ docs/model/SummarySource.md | 1 - docs/model/SummaryUpdatePayload.md | 1 - docs/model/VideoCreationPayload.md | 10 ++++++++++ docs/model/VideoUpdatePayload.md | 10 ++++++++++ package.json | 2 +- src/HttpClient.ts | 2 +- src/ObjectSerializer.ts | 3 +++ src/api/SummariesApi.ts | 8 ++++---- src/model/SummaryCreationPayload.ts | 11 +++++++++++ src/model/SummarySource.ts | 10 ---------- src/model/SummaryUpdatePayload.ts | 10 ---------- src/model/VideoCreationPayload.ts | 13 +++++++++++++ src/model/VideoUpdatePayload.ts | 13 +++++++++++++ 16 files changed, 81 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6941e60..e55a99c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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, ...) diff --git a/docs/api/SummariesApi.md b/docs/api/SummariesApi.md index c37e0f4..370ae1b 100644 --- a/docs/api/SummariesApi.md +++ b/docs/api/SummariesApi.md @@ -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 @@ -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 diff --git a/docs/model/SummaryCreationPayload.md b/docs/model/SummaryCreationPayload.md index 852d30b..a893f6d 100644 --- a/docs/model/SummaryCreationPayload.md +++ b/docs/model/SummaryCreationPayload.md @@ -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 `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. | [optional] +**attributes** | [**Array<SummaryCreationPayloadAttributesEnum>**](#Array<SummaryCreationPayloadAttributesEnum>) | 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] @@ -18,3 +19,12 @@ Auto | 'auto' +## Enum: Array<SummaryCreationPayloadAttributesEnum> + +Name | Value +---- | ----- +Abstract | 'abstract' +Takeaways | 'takeaways' + + + diff --git a/docs/model/SummarySource.md b/docs/model/SummarySource.md index c242ddd..4c821ea 100644 --- a/docs/model/SummarySource.md +++ b/docs/model/SummarySource.md @@ -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 `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. | [optional] **takeaways** | **Array<string>** | A list of 3 key points from the video, in chronological order. | [optional] diff --git a/docs/model/SummaryUpdatePayload.md b/docs/model/SummaryUpdatePayload.md index ca2ff80..f97fba1 100644 --- a/docs/model/SummaryUpdatePayload.md +++ b/docs/model/SummaryUpdatePayload.md @@ -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<string>** | A list of 3 key points from the video, in chronological order. | [optional] diff --git a/docs/model/VideoCreationPayload.md b/docs/model/VideoCreationPayload.md index 5659914..35b6e2a 100644 --- a/docs/model/VideoCreationPayload.md +++ b/docs/model/VideoCreationPayload.md @@ -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. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](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 `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` 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 `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. | [optional] +**transcriptSummaryAttributes** | [**Array<VideoCreationPayloadTranscriptSummaryAttributesEnum>**](#Array<VideoCreationPayloadTranscriptSummaryAttributesEnum>) | 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] @@ -62,3 +63,12 @@ Zh | 'zh' +## Enum: Array<VideoCreationPayloadTranscriptSummaryAttributesEnum> + +Name | Value +---- | ----- +Abstract | 'abstract' +Takeaways | 'takeaways' + + + diff --git a/docs/model/VideoUpdatePayload.md b/docs/model/VideoUpdatePayload.md index ea75053..7bbb08b 100644 --- a/docs/model/VideoUpdatePayload.md +++ b/docs/model/VideoUpdatePayload.md @@ -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. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](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 `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` 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 `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. | [optional] +**transcriptSummaryAttributes** | [**Array<VideoUpdatePayloadTranscriptSummaryAttributesEnum>**](#Array<VideoUpdatePayloadTranscriptSummaryAttributesEnum>) | 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] @@ -59,3 +60,12 @@ Zh | 'zh' +## Enum: Array<VideoUpdatePayloadTranscriptSummaryAttributesEnum> + +Name | Value +---- | ----- +Abstract | 'abstract' +Takeaways | 'takeaways' + + + diff --git a/package.json b/package.json index a10b9df..d0eafaa 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/HttpClient.ts b/src/HttpClient.ts index b201aa4..23ff90a 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -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 ? { diff --git a/src/ObjectSerializer.ts b/src/ObjectSerializer.ts index 55b0313..1091b42 100644 --- a/src/ObjectSerializer.ts +++ b/src/ObjectSerializer.ts @@ -128,10 +128,13 @@ const enumsMap: Set = new Set([ 'SummaryOriginEnum', 'SummarySourceStatusEnum', 'SummaryCreationPayloadOriginEnum', + 'SummaryCreationPayloadAttributesEnum', 'VideoLanguageOriginEnum', 'VideoCreationPayloadLanguageEnum', + 'VideoCreationPayloadTranscriptSummaryAttributesEnum', 'VideoStatusIngestStatusEnum', 'VideoUpdatePayloadLanguageEnum', + 'VideoUpdatePayloadTranscriptSummaryAttributesEnum', ]); const typeMap: { [index: string]: any } = { diff --git a/src/api/SummariesApi.ts b/src/api/SummariesApi.ts index fa7a42c..7b8cc15 100644 --- a/src/api/SummariesApi.ts +++ b/src/api/SummariesApi.ts @@ -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 */ @@ -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 */ @@ -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 @@ -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 diff --git a/src/model/SummaryCreationPayload.ts b/src/model/SummaryCreationPayload.ts index 0a733f3..0cb9479 100644 --- a/src/model/SummaryCreationPayload.ts +++ b/src/model/SummaryCreationPayload.ts @@ -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; static readonly discriminator?: string = undefined; @@ -36,6 +40,12 @@ export default class SummaryCreationPayload { type: 'SummaryCreationPayloadOriginEnum', format: '', }, + { + name: 'attributes', + baseName: 'attributes', + type: 'Array', + format: '', + }, ]; static getAttributeTypeMap(): Array { @@ -44,3 +54,4 @@ export default class SummaryCreationPayload { } export type SummaryCreationPayloadOriginEnum = 'auto'; +export type SummaryCreationPayloadAttributesEnum = 'abstract' | 'takeaways'; diff --git a/src/model/SummarySource.ts b/src/model/SummarySource.ts index b2582cd..fdfe6a2 100644 --- a/src/model/SummarySource.ts +++ b/src/model/SummarySource.ts @@ -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. */ @@ -28,12 +24,6 @@ export default class SummarySource { static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ - { - name: 'title', - baseName: 'title', - type: 'string', - format: '', - }, { name: '_abstract', baseName: 'abstract', diff --git a/src/model/SummaryUpdatePayload.ts b/src/model/SummaryUpdatePayload.ts index 6417787..a467317 100644 --- a/src/model/SummaryUpdatePayload.ts +++ b/src/model/SummaryUpdatePayload.ts @@ -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. */ @@ -28,12 +24,6 @@ export default class SummaryUpdatePayload { static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ - { - name: 'title', - baseName: 'title', - type: 'string', - format: '', - }, { name: '_abstract', baseName: 'abstract', diff --git a/src/model/VideoCreationPayload.ts b/src/model/VideoCreationPayload.ts index 67795bb..15fb608 100644 --- a/src/model/VideoCreationPayload.ts +++ b/src/model/VideoCreationPayload.ts @@ -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; static readonly discriminator?: string = undefined; @@ -153,6 +157,12 @@ export default class VideoCreationPayload { type: 'boolean', format: '', }, + { + name: 'transcriptSummaryAttributes', + baseName: 'transcriptSummaryAttributes', + type: 'Array', + format: '', + }, ]; static getAttributeTypeMap(): Array { @@ -194,3 +204,6 @@ export type VideoCreationPayloadLanguageEnum = | 'ur' | 'vi' | 'zh'; +export type VideoCreationPayloadTranscriptSummaryAttributesEnum = + | 'abstract' + | 'takeaways'; diff --git a/src/model/VideoUpdatePayload.ts b/src/model/VideoUpdatePayload.ts index cebef93..22127cc 100644 --- a/src/model/VideoUpdatePayload.ts +++ b/src/model/VideoUpdatePayload.ts @@ -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; static readonly discriminator?: string = undefined; @@ -127,6 +131,12 @@ export default class VideoUpdatePayload { type: 'boolean', format: '', }, + { + name: 'transcriptSummaryAttributes', + baseName: 'transcriptSummaryAttributes', + type: 'Array', + format: '', + }, ]; static getAttributeTypeMap(): Array { @@ -168,3 +178,6 @@ export type VideoUpdatePayloadLanguageEnum = | 'ur' | 'vi' | 'zh'; +export type VideoUpdatePayloadTranscriptSummaryAttributesEnum = + | 'abstract' + | 'takeaways';