Skip to content

Commit

Permalink
Merge pull request #405 from apivideo/ai-summary-updates
Browse files Browse the repository at this point in the history
Update Summary endpoints
  • Loading branch information
szekelyzol authored Nov 8, 2024
2 parents 216b719 + b300df1 commit 3bc2103
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
.flatMap(p -> p.vars.stream())
.forEach(v -> {
if (v.dataType.equals("List<String>")) {
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) {
Expand Down
2 changes: 2 additions & 0 deletions config/android.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/csharp.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/go.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/java.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/php.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/python.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 2 additions & 0 deletions config/swift5.yaml
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
45 changes: 31 additions & 14 deletions oas_apivideo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1390,7 +1390,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/summary-source'
$ref: '#/components/schemas/summary-source'
'409':
headers:
X-RateLimit-Limit:
Expand All @@ -1411,7 +1411,7 @@ paths:
schema:
$ref: '#/components/schemas/conflict-error'
examples:
Summary already exists:
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.
Expand Down Expand Up @@ -15982,6 +15982,10 @@ components:
playerId: pl45KFKdlddgk654dspkze
language: en
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
tags:
- maths
- string theory
Expand Down Expand Up @@ -16071,6 +16075,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:
Expand All @@ -16092,13 +16102,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.
Expand Down Expand Up @@ -16134,10 +16146,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.
Expand Down Expand Up @@ -16313,6 +16321,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
Expand All @@ -16321,6 +16335,9 @@ components:
language: 'en'
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
panoramic: false
mp4Support: true
tags:
Expand Down
2 changes: 1 addition & 1 deletion templates/php/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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 ⭐

Expand Down

0 comments on commit 3bc2103

Please sign in to comment.