From c373c6851ca491071d13c6cf5ce4fe73099be74d Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Tue, 5 Nov 2024 16:52:08 +0100 Subject: [PATCH 1/4] Update summary endpoints --- oas_apivideo.yaml | 67 ++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/oas_apivideo.yaml b/oas_apivideo.yaml index 6d45fd19..1ed95152 100644 --- a/oas_apivideo.yaml +++ b/oas_apivideo.yaml @@ -1049,10 +1049,10 @@ paths: tags: - Summaries summary: Generate video summary - description: Generate a title, abstract, and key takeaways for a video. + description: Generate an abstract and key takeaways for a video. x-client-action: create x-client-description: - default: 'Generate a title, abstract, and key takeaways for a video.' + default: 'Generate an abstract and key takeaways for a video.' operationId: POST_summaries security: - apiKey: [] @@ -1350,10 +1350,10 @@ paths: tags: - Summaries summary: Update summary details - description: Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. + description: Update details for a summary. x-client-action: update x-client-description: - default: 'Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`.' + default: 'Update details for a summary.' operationId: PATCH_summaries-summaryId-source parameters: - name: summaryId @@ -1391,32 +1391,6 @@ paths: application/json: schema: $ref: '#/components/schemas/summary-source' - '409': - headers: - X-RateLimit-Limit: - schema: - type: integer - description: The request limit per minute. - X-RateLimit-Remaining: - schema: - type: integer - description: The number of available requests left for the current time window. - X-RateLimit-Retry-After: - schema: - type: integer - description: The number of seconds left until the current rate limit window resets. - description: Conflict - content: - application/json: - schema: - $ref: '#/components/schemas/conflict-error' - examples: - Summary already exists: - value: - type: https://docs.api.video/reference/summary-already-exists - title: A summary already exists or is being created on this video. - status: 409 - detail: You can delete the existing summary and generate a new one. '/videos/{videoId}/source': post: tags: @@ -15982,6 +15956,10 @@ components: playerId: pl45KFKdlddgk654dspkze language: en transcript: true + transcriptSummary: true + transcriptSummaryAttributes: + - abstract + - takeaways tags: - maths - string theory @@ -16071,6 +16049,12 @@ components: - 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. + transcriptSummaryAttributes: + description: 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. + type: array + items: + type: string + enum: [abstract, takeaways] required: - title summary-creation-payload: @@ -16092,13 +16076,15 @@ components: In this case, `sourceStatus` will return `missing`, and you have to manually add a summary using the `PATCH /summaries/{summaryId}/source` endpoint operation. example: auto + attributes: + description: 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. + type: array + items: + type: string + enum: [abstract, takeaways] summary-update-payload: type: object properties: - title: - type: string - description: A video title, based on the contents of the video. - example: 'A short lecture on quantum theory' abstract: type: string description: A short outline of the contents of the video. @@ -16134,10 +16120,6 @@ components: summary-source: type: object properties: - title: - type: string - description: A video title, based on the contents of the video. - example: 'A short lecture on quantum theory' abstract: type: string description: 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. @@ -16313,6 +16295,12 @@ components: - 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. + transcriptSummaryAttributes: + description: 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. + type: array + items: + type: string + enum: [abstract, takeaways] example: playerId: pl45KFKdlddgk654dspkze title: String theory @@ -16321,6 +16309,9 @@ components: language: 'en' transcript: true transcriptSummary: true + transcriptSummaryAttributes: + - abstract + - takeaways panoramic: false mp4Support: true tags: From 2e95263374bbe8b6b44eee0845aa25ed20e5da33 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Tue, 5 Nov 2024 21:38:00 +0100 Subject: [PATCH 2/4] Re-add 409 for patch summary source --- oas_apivideo.yaml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/oas_apivideo.yaml b/oas_apivideo.yaml index 1ed95152..6a1c61d8 100644 --- a/oas_apivideo.yaml +++ b/oas_apivideo.yaml @@ -1390,7 +1390,33 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/summary-source' + $ref: '#/components/schemas/summary-source' + '409': + headers: + X-RateLimit-Limit: + schema: + type: integer + description: The request limit per minute. + X-RateLimit-Remaining: + schema: + type: integer + description: The number of available requests left for the current time window. + X-RateLimit-Retry-After: + schema: + type: integer + description: The number of seconds left until the current rate limit window resets. + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/conflict-error' + examples: + Summary generation still in progress: + value: + type: https://docs.api.video/reference/summary-already-exists + title: A summary already exists or is being created on this video. + status: 409 + detail: You can delete the existing summary and generate a new one. '/videos/{videoId}/source': post: tags: From e184f7ef35a11c725a3b256491c7b4493a348420 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Wed, 6 Nov 2024 09:47:35 +0100 Subject: [PATCH 3/4] Bump versions --- config/android.yaml | 2 ++ config/csharp.yaml | 2 ++ config/go.yaml | 2 ++ config/java.yaml | 2 ++ config/nodejs.yaml | 2 ++ config/php.yaml | 2 ++ config/python.yaml | 2 ++ config/swift5.yaml | 2 ++ 8 files changed, 16 insertions(+) diff --git a/config/android.yaml b/config/android.yaml index 45ecdbc5..5563fc15 100644 --- a/config/android.yaml +++ b/config/android.yaml @@ -1,4 +1,6 @@ changelog: + - 1.6.7 (2024-11-06): + - AI summary updates - 1.6.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.6.5 (2024-10-21): diff --git a/config/csharp.yaml b/config/csharp.yaml index 23edc417..9df497af 100644 --- a/config/csharp.yaml +++ b/config/csharp.yaml @@ -1,4 +1,6 @@ changelog: + - 1.6.7 (2024-11-06): + - AI summary updates - 1.6.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.6.5 (2024-10-21): diff --git a/config/go.yaml b/config/go.yaml index 08ee22a2..15e3db8f 100644 --- a/config/go.yaml +++ b/config/go.yaml @@ -1,4 +1,6 @@ changelog: + - 1.4.7 (2024-11-06): + - AI summary updates - 1.4.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.4.5 (2024-10-21): diff --git a/config/java.yaml b/config/java.yaml index 927c25f9..19fc2711 100644 --- a/config/java.yaml +++ b/config/java.yaml @@ -1,4 +1,6 @@ changelog: + - 1.4.7 (2024-11-06): + - AI summary updates - 1.4.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.4.5 (2024-10-21): diff --git a/config/nodejs.yaml b/config/nodejs.yaml index f1c1e93a..0d23f5c8 100644 --- a/config/nodejs.yaml +++ b/config/nodejs.yaml @@ -1,4 +1,6 @@ changelog: + - 2.6.8 (2024-11-06): + - AI summary updates - 2.6.7 (2024-11-04): - Analytics updates (ccv, views, ...) - 2.6.6 (2024-10-21): diff --git a/config/php.yaml b/config/php.yaml index a994fee6..b355c12e 100644 --- a/config/php.yaml +++ b/config/php.yaml @@ -1,4 +1,6 @@ changelog: + - 1.4.7 (2024-11-06): + - AI summary updates - 1.4.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.4.5 (2024-10-21): diff --git a/config/python.yaml b/config/python.yaml index efdc3235..b60026ab 100644 --- a/config/python.yaml +++ b/config/python.yaml @@ -1,4 +1,6 @@ changelog: + - 1.4.7 (2024-11-06): + - AI summary updates - 1.4.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.4.5 (2024-10-21): diff --git a/config/swift5.yaml b/config/swift5.yaml index fa500761..47362a8d 100644 --- a/config/swift5.yaml +++ b/config/swift5.yaml @@ -1,4 +1,6 @@ changelog: + - 1.3.7 (2024-11-06): + - AI summary updates - 1.3.6 (2024-11-04): - Analytics updates (ccv, views, ...) - 1.3.5 (2024-10-21): From b300df1c5ddc0ae1d8bfb5f61a5660352334b3c4 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Wed, 6 Nov 2024 09:48:06 +0100 Subject: [PATCH 4/4] Fix java generator --- .../src/main/java/video/api/client/generator/Java.java | 10 ++++++---- templates/php/README.mustache | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apivideo-generator/src/main/java/video/api/client/generator/Java.java b/apivideo-generator/src/main/java/video/api/client/generator/Java.java index e68412f6..915776e6 100644 --- a/apivideo-generator/src/main/java/video/api/client/generator/Java.java +++ b/apivideo-generator/src/main/java/video/api/client/generator/Java.java @@ -75,10 +75,12 @@ public Map postProcessOperationsWithModels(Map o .flatMap(p -> p.vars.stream()) .forEach(v -> { if (v.dataType.equals("List")) { - v.example = "Arrays.asList(" + v.example - .replaceAll("\\[", "") - .replaceAll("\\]", "") - .replaceAll("\\\\\"", "\"") + ")"; + if(v.example != null) { + v.example = "Arrays.asList(" + v.example + .replaceAll("\\[", "") + .replaceAll("\\]", "") + .replaceAll("\\\\\"", "\"") + ")"; + } } else if (v.isArray) { v.example = "Collections.<" + v.items.dataType + ">emptyList()"; } else if (v.isString) { diff --git a/templates/php/README.mustache b/templates/php/README.mustache index cc1068e7..0df524e1 100644 --- a/templates/php/README.mustache +++ b/templates/php/README.mustache @@ -180,7 +180,7 @@ $ BASE_URI="" API_KEY="..." vendor/bin/phpunit ``` -## Have you gotten use from this API client? +## Have you gotten use from this API client? Please take a moment to leave a star on the client ⭐