Skip to content

Commit

Permalink
Merge pull request #104 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 88b87dc + 31f379c commit 28f4c83
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 142 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.4.7] - 2024-11-06
- AI summary updates

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

Expand Down
58 changes: 42 additions & 16 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ paths:
x-group-parameters: true
x-client-paginated: true
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 @@ -1418,7 +1418,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.
/summaries/{summaryId}:
delete:
description: Delete a summary tied to a video.
Expand Down Expand Up @@ -1550,8 +1550,7 @@ paths:
x-client-description:
default: Get all details for a summary.
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 @@ -1601,7 +1600,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 @@ -1637,8 +1636,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.
/videos/{videoId}/source:
post:
description: Ingest a video from a source or file.
Expand Down Expand Up @@ -16566,6 +16564,10 @@ components:
playerId: pl45KFKdlddgk654dspkze
language: en
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
tags:
- maths
- string theory
Expand Down Expand Up @@ -16694,6 +16696,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 @@ -16715,15 +16727,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 @@ -16768,12 +16786,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 @@ -16946,6 +16959,9 @@ components:
language: en
transcript: true
transcriptSummary: true
transcriptSummaryAttributes:
- abstract
- takeaways
panoramic: false
mp4Support: true
tags:
Expand Down Expand Up @@ -17058,6 +17074,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
8 changes: 4 additions & 4 deletions api_summaries.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (c *Client) prepareRequest(
req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue)
}

req.Header.Set("AV-Origin-Client", "go:1.4.6")
req.Header.Set("AV-Origin-Client", "go:1.4.7")

for headerName := range headerParams {
req.Header.Set(headerName, headerParams[headerName])
Expand Down Expand Up @@ -534,7 +534,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) {
req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue)
}

req.Header.Set("AV-Origin-Client", "go:1.4.6")
req.Header.Set("AV-Origin-Client", "go:1.4.7")

resp, err := c.httpClient.Do(req)

Expand Down
26 changes: 26 additions & 0 deletions docs/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VideoId** | **string** | Create a summary of a video using the video ID. |
**Origin** | Pointer to **string** | 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** | Pointer to **[]string** | 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]

## Methods

Expand Down Expand Up @@ -71,6 +72,31 @@ SetOrigin sets Origin field to given value.

HasOrigin returns a boolean if a field has been set.

### GetAttributes

`func (o *SummaryCreationPayload) GetAttributes() []string`

GetAttributes returns the Attributes field if non-nil, zero value otherwise.

### GetAttributesOk

`func (o *SummaryCreationPayload) GetAttributesOk() (*[]string, bool)`

GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAttributes

`func (o *SummaryCreationPayload) SetAttributes(v []string)`

SetAttributes sets Attributes field to given value.

### HasAttributes

`func (o *SummaryCreationPayload) HasAttributes() bool`

HasAttributes returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
26 changes: 0 additions & 26 deletions docs/SummarySource.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Title** | Pointer to **string** | A video title, based on the contents of the video. | [optional]
**Abstract** | Pointer to **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** | Pointer to **[]string** | A list of 3 key points from the video, in chronological order. | [optional]

Expand All @@ -27,31 +26,6 @@ NewSummarySourceWithDefaults instantiates a new SummarySource object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetTitle

`func (o *SummarySource) GetTitle() string`

GetTitle returns the Title field if non-nil, zero value otherwise.

### GetTitleOk

`func (o *SummarySource) GetTitleOk() (*string, bool)`

GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTitle

`func (o *SummarySource) SetTitle(v string)`

SetTitle sets Title field to given value.

### HasTitle

`func (o *SummarySource) HasTitle() bool`

HasTitle returns a boolean if a field has been set.

### GetAbstract

`func (o *SummarySource) GetAbstract() string`
Expand Down
26 changes: 0 additions & 26 deletions docs/SummaryUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Title** | Pointer to **string** | A video title, based on the contents of the video. | [optional]
**Abstract** | Pointer to **string** | A short outline of the contents of the video. | [optional]
**Takeaways** | Pointer to **[]string** | A list of 3 key points from the video, in chronological order. | [optional]

Expand All @@ -27,31 +26,6 @@ NewSummaryUpdatePayloadWithDefaults instantiates a new SummaryUpdatePayload obje
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetTitle

`func (o *SummaryUpdatePayload) GetTitle() string`

GetTitle returns the Title field if non-nil, zero value otherwise.

### GetTitleOk

`func (o *SummaryUpdatePayload) GetTitleOk() (*string, bool)`

GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTitle

`func (o *SummaryUpdatePayload) SetTitle(v string)`

SetTitle sets Title field to given value.

### HasTitle

`func (o *SummaryUpdatePayload) HasTitle() bool`

HasTitle returns a boolean if a field has been set.

### GetAbstract

`func (o *SummaryUpdatePayload) GetAbstract() string`
Expand Down
26 changes: 26 additions & 0 deletions docs/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Name | Type | Description | Notes
**Language** | Pointer to **NullableString** | 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** | Pointer to **bool** | 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** | Pointer to **bool** | 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** | Pointer to **[]string** | 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]

## Methods

Expand Down Expand Up @@ -393,6 +394,31 @@ SetTranscriptSummary sets TranscriptSummary field to given value.

HasTranscriptSummary returns a boolean if a field has been set.

### GetTranscriptSummaryAttributes

`func (o *VideoCreationPayload) GetTranscriptSummaryAttributes() []string`

GetTranscriptSummaryAttributes returns the TranscriptSummaryAttributes field if non-nil, zero value otherwise.

### GetTranscriptSummaryAttributesOk

`func (o *VideoCreationPayload) GetTranscriptSummaryAttributesOk() (*[]string, bool)`

GetTranscriptSummaryAttributesOk returns a tuple with the TranscriptSummaryAttributes field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTranscriptSummaryAttributes

`func (o *VideoCreationPayload) SetTranscriptSummaryAttributes(v []string)`

SetTranscriptSummaryAttributes sets TranscriptSummaryAttributes field to given value.

### HasTranscriptSummaryAttributes

`func (o *VideoCreationPayload) HasTranscriptSummaryAttributes() bool`

HasTranscriptSummaryAttributes returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Loading

0 comments on commit 28f4c83

Please sign in to comment.