Skip to content

Commit

Permalink
Merge pull request #129 from apivideo/ai-summary-updates
Browse files Browse the repository at this point in the history
Update Summary endpoints
  • Loading branch information
bot-api-video authored Nov 8, 2024
2 parents 889ea28 + e641f59 commit 994ee6e
Show file tree
Hide file tree
Showing 20 changed files with 363 additions and 102 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.

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

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

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>video.api</groupId>
<artifactId>android-api-client</artifactId>
<version>1.6.6</version>
<version>1.6.7</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -82,7 +82,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
implementation "video.api:android-api-client:1.6.6"
implementation "video.api:android-api-client:1.6.7"
```

#### Others
Expand All @@ -95,7 +95,7 @@ mvn clean package

Then manually install the following JARs:

* `target/android-api-client-1.6.6.jar`
* `target/android-api-client-1.6.7.jar`
* `target/lib/*.jar`

### Code sample
Expand Down
58 changes: 42 additions & 16 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ paths:
x-client-paginated: true
x-accepts: application/json
post:
description: Generate a title, abstract, and key takeaways for a video.
description: Generate an abstract and key takeaways for a video.
operationId: POST_summaries
requestBody:
content:
Expand Down Expand Up @@ -1427,7 +1427,7 @@ paths:
- Summaries
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.
x-contentType: application/json
x-accepts: application/json
/summaries/{summaryId}:
Expand Down Expand Up @@ -1563,8 +1563,7 @@ paths:
default: Get all details for a summary.
x-accepts: application/json
patch:
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.
operationId: PATCH_summaries-summaryId-source
parameters:
- description: The unique identifier of the summary source you want to update.
Expand Down Expand Up @@ -1614,7 +1613,7 @@ paths:
content:
application/json:
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 @@ -1650,8 +1649,7 @@ paths:
- Summaries
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.
x-contentType: application/json
x-accepts: application/json
/videos/{videoId}/source:
Expand Down Expand Up @@ -16648,6 +16646,10 @@ components:
playerId: pl45KFKdlddgk654dspkze
language: en
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
tags:
- maths
- string theory
Expand Down Expand Up @@ -16776,6 +16778,16 @@ components:
- 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.
type: boolean
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.
items:
enum:
- abstract
- takeaways
type: string
type: array
required:
- title
title: VideoCreationPayload
Expand All @@ -16797,15 +16809,21 @@ components:
- auto
example: auto
type: string
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.
items:
enum:
- abstract
- takeaways
type: string
type: array
required:
- videoId
type: object
summary-update-payload:
properties:
title:
description: A video title, based on the contents of the video.
example: A short lecture on quantum theory
type: string
abstract:
description: A short outline of the contents of the video.
example: In this lecture, we discuss how complicated quantum theory is,
Expand Down Expand Up @@ -16850,12 +16868,7 @@ components:
abstract: In this lecture, we discuss how complicated quantum theory is, using
the famous example of Schrödingers cat. We also discuss practical applications
like quantum computing.
title: A short lecture on quantum theory
properties:
title:
description: A video title, based on the contents of the video.
example: A short lecture on quantum theory
type: string
abstract:
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
Expand Down Expand Up @@ -17028,6 +17041,9 @@ components:
language: en
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
panoramic: false
mp4Support: true
tags:
Expand Down Expand Up @@ -17140,6 +17156,16 @@ components:
\ video. If you do not define a language, the API detects it based on\
\ the video."
type: boolean
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.
items:
enum:
- abstract
- takeaways
type: string
type: array
title: VideoUpdatePayload
type: object
discarded-video-update-payload:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'

group = 'video.api'
version = '1.6.6'
version = '1.6.7'

buildscript {
repositories {
Expand Down
6 changes: 3 additions & 3 deletions docs/SummariesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Method | HTTP request | Description
Generate video summary

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

### Example
```java
Expand All @@ -45,6 +45,7 @@ public class Example {
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.
summaryCreationPayload.setAttributes(); // 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.


try {
Expand Down Expand Up @@ -95,7 +96,7 @@ Name | Type | Description | Notes
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.

### Example
```java
Expand All @@ -116,7 +117,6 @@ public class Example {

String summaryId = "summary_1CGHWuXjhxmeH4WiZ51234"; // The unique identifier of the summary source you want to update.
SummaryUpdatePayload summaryUpdatePayload = new SummaryUpdatePayload(); //
summaryUpdatePayload.setTitle("A short lecture on quantum theory"); // A video title, based on the contents of the video.
summaryUpdatePayload.setAbstract("In this lecture, we discuss how complicated quantum theory is, using the famous example of Schrödingers cat. We also discuss practical applications like quantum computing."); // A short outline of the contents of the video.
summaryUpdatePayload.setTakeaways(Arrays.asList("Quantum theory is complicated.","Schrödinger's cat is neither dead, nor alive.","Quantum computers are super cool.")); // A list of 3 key points from the video, in chronological order.

Expand Down
10 changes: 10 additions & 0 deletions docs/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**videoId** | **String** | Create a summary of a video using the video ID. |
**origin** | [**OriginEnum**](#OriginEnum) | 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** | [**List&lt;AttributesEnum&gt;**](#List&lt;AttributesEnum&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,6 +19,15 @@ Name | Value
AUTO | &quot;auto&quot;



## Enum: List&lt;AttributesEnum&gt;

Name | Value
---- | -----
ABSTRACT | &quot;abstract&quot;
TAKEAWAYS | &quot;takeaways&quot;


## Implemented Interfaces

* Serializable
Expand Down
1 change: 0 additions & 1 deletion docs/SummarySource.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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** | **List&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/SummaryUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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** | **List&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/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Name | Type | Description | Notes
**language** | [**LanguageEnum**](#LanguageEnum) | 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** | [**List&lt;TranscriptSummaryAttributesEnum&gt;**](#List&lt;TranscriptSummaryAttributesEnum&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,6 +63,15 @@ VI | &quot;vi&quot;
ZH | &quot;zh&quot;



## Enum: List&lt;TranscriptSummaryAttributesEnum&gt;

Name | Value
---- | -----
ABSTRACT | &quot;abstract&quot;
TAKEAWAYS | &quot;takeaways&quot;


## Implemented Interfaces

* Serializable
Expand Down
10 changes: 10 additions & 0 deletions docs/VideoUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Name | Type | Description | Notes
**language** | [**LanguageEnum**](#LanguageEnum) | 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** | [**List&lt;TranscriptSummaryAttributesEnum&gt;**](#List&lt;TranscriptSummaryAttributesEnum&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,6 +60,15 @@ VI | &quot;vi&quot;
ZH | &quot;zh&quot;



## Enum: List&lt;TranscriptSummaryAttributesEnum&gt;

Name | Value
---- | -----
ABSTRACT | &quot;abstract&quot;
TAKEAWAYS | &quot;takeaways&quot;


## Implemented Interfaces

* Serializable
Expand Down
2 changes: 2 additions & 0 deletions docs/VideosApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class Example {
- 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.
videoCreationPayload.setTranscriptSummaryAttributes(); // 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.


try {
Expand Down Expand Up @@ -458,6 +459,7 @@ public class Example {
- 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.
videoUpdatePayload.setTranscriptSummaryAttributes(); // 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.
try {
Expand Down
4 changes: 2 additions & 2 deletions maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
return !"1.6.6".contains("SNAPSHOT")
return !"1.6.7".contains("SNAPSHOT")
}

def getReleaseRepositoryUrl() {
Expand Down Expand Up @@ -57,7 +57,7 @@ afterEvaluate {

groupId = "video.api"
artifactId = "android-api-client"
version = "1.6.6"
version = "1.6.7"

pom {
name = "video.api:android-api-client"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>android-api-client</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>1.6.6</version>
<version>1.6.7</version>
<url>https://github.com/apivideo/api.video-android-client</url>
<description>The official Android api.video client</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/video/api/client/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private OkHttpClient initHttpClient(List<Interceptor> interceptors) {
private void init() {
verifyingSsl = true;
json = new JSON();
addDefaultHeader("AV-Origin-Client", "android:1.6.6");
addDefaultHeader("AV-Origin-Client", "android:1.6.7");
}

private boolean isValid(String regex, String field) {
Expand Down
Loading

0 comments on commit 994ee6e

Please sign in to comment.