From 923cd806a944aa6ebab06ccde6de299f413ccdca Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Wed, 6 Nov 2024 08:50:14 +0000 Subject: [PATCH] Update Summary endpoints --- CHANGELOG.md | 3 +++ apivideo/__init__.py | 2 +- apivideo/api/summaries_api.py | 4 ++-- apivideo/api_client.py | 2 +- apivideo/configuration.py | 2 +- apivideo/model/summary_creation_payload.py | 7 +++++++ apivideo/model/summary_source.py | 3 --- apivideo/model/summary_update_payload.py | 3 --- apivideo/model/video_creation_payload.py | 7 +++++++ apivideo/model/video_update_payload.py | 7 +++++++ docs/SummariesApi.md | 8 +++++--- docs/SummaryCreationPayload.md | 1 + docs/SummarySource.md | 1 - docs/SummaryUpdatePayload.md | 1 - docs/VideoCreationPayload.md | 1 + docs/VideoUpdatePayload.md | 1 + docs/VideosApi.md | 6 ++++++ setup.py | 2 +- test/test_summaries_api.py | 3 +++ test/test_videos_api.py | 6 ++++++ 20 files changed, 53 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef07c0..b5151d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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, ...) diff --git a/apivideo/__init__.py b/apivideo/__init__.py index 580774a..f208ce7 100644 --- a/apivideo/__init__.py +++ b/apivideo/__init__.py @@ -9,7 +9,7 @@ """ -__version__ = "1.4.6" +__version__ = "1.4.7" # import ApiVideoClient from apivideo.auth_api_client import AuthenticatedApiClient diff --git a/apivideo/api/summaries_api.py b/apivideo/api/summaries_api.py index 71d67ee..428b7d4 100644 --- a/apivideo/api/summaries_api.py +++ b/apivideo/api/summaries_api.py @@ -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 @@ -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 diff --git a/apivideo/api_client.py b/apivideo/api_client.py index 8b3d001..b271938 100644 --- a/apivideo/api_client.py +++ b/apivideo/api_client.py @@ -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 diff --git a/apivideo/configuration.py b/apivideo/configuration.py index a1e0abe..940b63d 100644 --- a/apivideo/configuration.py +++ b/apivideo/configuration.py @@ -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): diff --git a/apivideo/model/summary_creation_payload.py b/apivideo/model/summary_creation_payload.py index 530268e..1a6a770 100644 --- a/apivideo/model/summary_creation_payload.py +++ b/apivideo/model/summary_creation_payload.py @@ -54,6 +54,10 @@ class SummaryCreationPayload(ModelNormal): ('origin',): { 'AUTO': "auto", }, + ('attributes',): { + 'ABSTRACT': "abstract", + 'TAKEAWAYS': "takeaways", + }, } validations = { @@ -76,6 +80,7 @@ def openapi_types(): return { 'video_id': (str,), # noqa: E501 'origin': (str,), # noqa: E501 + 'attributes': ([str],), # noqa: E501 } @cached_property @@ -86,6 +91,7 @@ def discriminator(): attribute_map = { 'video_id': 'videoId', # noqa: E501 'origin': 'origin', # noqa: E501 + 'attributes': 'attributes', # noqa: E501 } _composed_schemas = {} @@ -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) diff --git a/apivideo/model/summary_source.py b/apivideo/model/summary_source.py index add9c3c..99c9509 100644 --- a/apivideo/model/summary_source.py +++ b/apivideo/model/summary_source.py @@ -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 } @@ -85,7 +84,6 @@ def discriminator(): attribute_map = { - 'title': 'title', # noqa: E501 'abstract': 'abstract', # noqa: E501 'takeaways': 'takeaways', # noqa: E501 } @@ -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 """ diff --git a/apivideo/model/summary_update_payload.py b/apivideo/model/summary_update_payload.py index 6a8fe2f..c5bff33 100644 --- a/apivideo/model/summary_update_payload.py +++ b/apivideo/model/summary_update_payload.py @@ -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 } @@ -85,7 +84,6 @@ def discriminator(): attribute_map = { - 'title': 'title', # noqa: E501 'abstract': 'abstract', # noqa: E501 'takeaways': 'takeaways', # noqa: E501 } @@ -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 """ diff --git a/apivideo/model/video_creation_payload.py b/apivideo/model/video_creation_payload.py index 9dfbfd4..7a1c57c 100644 --- a/apivideo/model/video_creation_payload.py +++ b/apivideo/model/video_creation_payload.py @@ -95,6 +95,10 @@ class VideoCreationPayload(ModelNormal): 'VI': "vi", 'ZH': "zh", }, + ('transcript_summary_attributes',): { + 'ABSTRACT': "abstract", + 'TAKEAWAYS': "takeaways", + }, } validations = { @@ -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 @@ -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 = {} @@ -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) diff --git a/apivideo/model/video_update_payload.py b/apivideo/model/video_update_payload.py index 1a3e1c7..617ce90 100644 --- a/apivideo/model/video_update_payload.py +++ b/apivideo/model/video_update_payload.py @@ -91,6 +91,10 @@ class VideoUpdatePayload(ModelNormal): 'VI': "vi", 'ZH': "zh", }, + ('transcript_summary_attributes',): { + 'ABSTRACT': "abstract", + 'TAKEAWAYS': "takeaways", + }, } validations = { @@ -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 @@ -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 = {} @@ -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) diff --git a/docs/SummariesApi.md b/docs/SummariesApi.md index 0a0e570..be639dd 100644 --- a/docs/SummariesApi.md +++ b/docs/SummariesApi.md @@ -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 @@ -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 @@ -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 @@ -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 | diff --git a/docs/SummaryCreationPayload.md b/docs/SummaryCreationPayload.md index eee492d..d9f93f7 100644 --- a/docs/SummaryCreationPayload.md +++ b/docs/SummaryCreationPayload.md @@ -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) diff --git a/docs/SummarySource.md b/docs/SummarySource.md index 2bee81d..1123e0e 100644 --- a/docs/SummarySource.md +++ b/docs/SummarySource.md @@ -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] diff --git a/docs/SummaryUpdatePayload.md b/docs/SummaryUpdatePayload.md index e422d65..e7fcade 100644 --- a/docs/SummaryUpdatePayload.md +++ b/docs/SummaryUpdatePayload.md @@ -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] diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index a5612ef..0303e9b 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -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) diff --git a/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index c9c1008..824d836 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -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) diff --git a/docs/VideosApi.md b/docs/VideosApi.md index 4c5e3c6..d762efd 100644 --- a/docs/VideosApi.md +++ b/docs/VideosApi.md @@ -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 @@ -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 diff --git a/setup.py b/setup.py index ed2c26c..b06310d 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "api.video" -VERSION = "1.4.6" +VERSION = "1.4.7" # To install the library, run the following # # python setup.py install diff --git a/test/test_summaries_api.py b/test/test_summaries_api.py index ffdfa8c..8aff0c2 100644 --- a/test/test_summaries_api.py +++ b/test/test_summaries_api.py @@ -51,6 +51,9 @@ def test_create(self): 'summary_creation_payload': SummaryCreationPayload( video_id="vi4k0jvEUuaTdRAEjQ4Jfrgz", origin="auto", + attributes=[ + "abstract", + ], ), } url = '/summaries'.format(**kwargs) diff --git a/test/test_videos_api.py b/test/test_videos_api.py index f7051d9..62f6660 100644 --- a/test/test_videos_api.py +++ b/test/test_videos_api.py @@ -84,6 +84,9 @@ def test_create(self): language="fr", transcript=True, transcript_summary=True, + transcript_summary_attributes=[ + "abstract", + ], ), } url = '/videos'.format(**kwargs) @@ -204,6 +207,9 @@ def test_update(self): language="fr", transcript=True, transcript_summary=True, + transcript_summary_attributes=[ + "abstract", + ], ), } url = '/videos/{video_id}'.format(**kwargs)