Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Summary endpoints #106

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion apivideo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""


__version__ = "1.4.6"
__version__ = "1.4.7"

# import ApiVideoClient
from apivideo.auth_api_client import AuthenticatedApiClient
Expand Down
4 changes: 2 additions & 2 deletions apivideo/api/summaries_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def create(
):
"""Generate video summary # noqa: E501

Generate a title, abstract, and key takeaways for a video. # noqa: E501
Generate an abstract and key takeaways for a video. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down Expand Up @@ -171,7 +171,7 @@ def update(
):
"""Update summary details # noqa: E501

Update details for a summary. Note that this operation is only allowed for summary objects where `sourceStatus` is `missing`. # noqa: E501
Update details for a summary. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down
2 changes: 1 addition & 1 deletion apivideo/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie

self.default_headers['AV-Origin-Client'] = "python:1.4.6"
self.default_headers['AV-Origin-Client'] = "python:1.4.7"

def __enter__(self):
return self
Expand Down
2 changes: 1 addition & 1 deletion apivideo/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 1\n"\
"SDK Package Version: 1.4.6".\
"SDK Package Version: 1.4.7".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
7 changes: 7 additions & 0 deletions apivideo/model/summary_creation_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class SummaryCreationPayload(ModelNormal):
('origin',): {
'AUTO': "auto",
},
('attributes',): {
'ABSTRACT': "abstract",
'TAKEAWAYS': "takeaways",
},
}

validations = {
Expand All @@ -76,6 +80,7 @@ def openapi_types():
return {
'video_id': (str,), # noqa: E501
'origin': (str,), # noqa: E501
'attributes': ([str],), # noqa: E501
}

@cached_property
Expand All @@ -86,6 +91,7 @@ def discriminator():
attribute_map = {
'video_id': 'videoId', # noqa: E501
'origin': 'origin', # noqa: E501
'attributes': 'attributes', # noqa: E501
}

_composed_schemas = {}
Expand Down Expand Up @@ -138,6 +144,7 @@ def __init__(self, video_id, *args, **kwargs): # noqa: E501
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
origin (str): 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] if omitted the server will use the default value of "auto" # noqa: E501
attributes ([str]): 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] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
3 changes: 0 additions & 3 deletions apivideo/model/summary_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def openapi_types():
and the value is attribute type.
"""
return {
'title': (str,), # noqa: E501
'abstract': (str,), # noqa: E501
'takeaways': ([str],), # noqa: E501
}
Expand All @@ -85,7 +84,6 @@ def discriminator():


attribute_map = {
'title': 'title', # noqa: E501
'abstract': 'abstract', # noqa: E501
'takeaways': 'takeaways', # noqa: E501
}
Expand Down Expand Up @@ -136,7 +134,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
title (str): A video title, based on the contents of the video.. [optional] # noqa: E501
abstract (str): 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] # noqa: E501
takeaways ([str]): A list of 3 key points from the video, in chronological order.. [optional] # noqa: E501
"""
Expand Down
3 changes: 0 additions & 3 deletions apivideo/model/summary_update_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def openapi_types():
and the value is attribute type.
"""
return {
'title': (str,), # noqa: E501
'abstract': (str,), # noqa: E501
'takeaways': ([str],), # noqa: E501
}
Expand All @@ -85,7 +84,6 @@ def discriminator():


attribute_map = {
'title': 'title', # noqa: E501
'abstract': 'abstract', # noqa: E501
'takeaways': 'takeaways', # noqa: E501
}
Expand Down Expand Up @@ -136,7 +134,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
title (str): A video title, based on the contents of the video.. [optional] # noqa: E501
abstract (str): A short outline of the contents of the video.. [optional] # noqa: E501
takeaways ([str]): A list of 3 key points from the video, in chronological order.. [optional] # noqa: E501
"""
Expand Down
7 changes: 7 additions & 0 deletions apivideo/model/video_creation_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ class VideoCreationPayload(ModelNormal):
'VI': "vi",
'ZH': "zh",
},
('transcript_summary_attributes',): {
'ABSTRACT': "abstract",
'TAKEAWAYS': "takeaways",
},
}

validations = {
Expand Down Expand Up @@ -130,6 +134,7 @@ def openapi_types():
'language': (str, none_type,), # noqa: E501
'transcript': (bool,), # noqa: E501
'transcript_summary': (bool,), # noqa: E501
'transcript_summary_attributes': ([str],), # noqa: E501
}

@cached_property
Expand All @@ -152,6 +157,7 @@ def discriminator():
'language': 'language', # noqa: E501
'transcript': 'transcript', # noqa: E501
'transcript_summary': 'transcriptSummary', # noqa: E501
'transcript_summary_attributes': 'transcriptSummaryAttributes', # noqa: E501
}

_composed_schemas = {}
Expand Down Expand Up @@ -216,6 +222,7 @@ def __init__(self, title, *args, **kwargs): # noqa: E501
language (str, none_type): 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] # noqa: E501
transcript (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] # noqa: E501
transcript_summary (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] # noqa: E501
transcript_summary_attributes ([str]): 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] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
7 changes: 7 additions & 0 deletions apivideo/model/video_update_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class VideoUpdatePayload(ModelNormal):
'VI': "vi",
'ZH': "zh",
},
('transcript_summary_attributes',): {
'ABSTRACT': "abstract",
'TAKEAWAYS': "takeaways",
},
}

validations = {
Expand Down Expand Up @@ -123,6 +127,7 @@ def openapi_types():
'language': (str, none_type,), # noqa: E501
'transcript': (bool,), # noqa: E501
'transcript_summary': (bool,), # noqa: E501
'transcript_summary_attributes': ([str],), # noqa: E501
}

@cached_property
Expand All @@ -142,6 +147,7 @@ def discriminator():
'language': 'language', # noqa: E501
'transcript': 'transcript', # noqa: E501
'transcript_summary': 'transcriptSummary', # noqa: E501
'transcript_summary_attributes': 'transcriptSummaryAttributes', # noqa: E501
}

_composed_schemas = {}
Expand Down Expand Up @@ -201,6 +207,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
language (str, none_type): 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] # noqa: E501
transcript (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] # noqa: E501
transcript_summary (bool): 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] # noqa: E501
transcript_summary_attributes ([str]): 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] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
8 changes: 5 additions & 3 deletions docs/SummariesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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

Expand All @@ -35,6 +35,9 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
summary_creation_payload = SummaryCreationPayload(
video_id="vi4k0jvEUuaTdRAEjQ4Jfrgz",
origin="auto",
attributes=[
"abstract",
],
) # SummaryCreationPayload |

# example passing only required values which don't have defaults set
Expand Down Expand Up @@ -77,7 +80,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

Expand All @@ -95,7 +98,6 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
api_instance = summaries_api.SummariesApi(api_client)
summary_id = "summary_1CGHWuXjhxmeH4WiZ51234" # str | The unique identifier of the summary source you want to update.
summary_update_payload = SummaryUpdatePayload(
title="A short lecture on quantum theory",
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.",
takeaways=["Quantum theory is complicated.","Schrödinger's cat is neither dead, nor alive.","Quantum computers are super cool."],
) # SummaryUpdatePayload |
Expand Down
1 change: 1 addition & 0 deletions docs/SummaryCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**video_id** | **str** | Create a summary of a video using the video ID. |
**origin** | **str** | 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] if omitted the server will use the default value of "auto"
**attributes** | **[str]** | 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]

[[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
1 change: 0 additions & 1 deletion docs/SummarySource.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **str** | A video title, based on the contents of the video. | [optional]
**abstract** | **str** | 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** | **[str]** | 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 @@ -3,7 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **str** | A video title, based on the contents of the video. | [optional]
**abstract** | **str** | A short outline of the contents of the video. | [optional]
**takeaways** | **[str]** | A list of 3 key points from the video, in chronological order. | [optional]

Expand Down
1 change: 1 addition & 0 deletions docs/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Name | Type | Description | Notes
**language** | **str, none_type** | 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** | **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]
**transcript_summary** | **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]
**transcript_summary_attributes** | **[str]** | 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]

[[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
1 change: 1 addition & 0 deletions docs/VideoUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Name | Type | Description | Notes
**language** | **str, none_type** | 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** | **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]
**transcript_summary** | **bool** | 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]
**transcript_summary_attributes** | **[str]** | 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]

[[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
6 changes: 6 additions & 0 deletions docs/VideosApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
language="fr",
transcript=True,
transcript_summary=True,
transcript_summary_attributes=[
"abstract",
],
) # VideoCreationPayload | video to create

# example passing only required values which don't have defaults set
Expand Down Expand Up @@ -428,6 +431,9 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
language="fr",
transcript=True,
transcript_summary=True,
transcript_summary_attributes=[
"abstract",
],
) # VideoUpdatePayload |

# example passing only required values which don't have defaults set
Expand Down
Loading
Loading