Skip to content

Commit 789af5f

Browse files
committed
update docstrings
1 parent 8099df7 commit 789af5f

File tree

6 files changed

+49
-52
lines changed

6 files changed

+49
-52
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ Now that you have established a connection to VideoDB, you can upload your video
7575
You can directly upload from `youtube`, `any public url`, `S3 bucket` or a `local file path`. A default collection is created when you create your first connection.
7676

7777
`upload` method returns a `Video` object. You can simply pass a single string
78-
representing either a local file path or a URL. The optional second positional
79-
argument is `media_type`, keeping backwards compatibility. For explicit calls,
80-
use the ``source`` parameter.
78+
representing either a local file path or a URL.
8179

8280
```python
8381
# Upload a video by url

tests/test_upload.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

videodb/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""About information for videodb sdk"""
22

3-
__version__ = "0.2.18"
3+
__version__ = "0.2.16"
44
__title__ = "videodb"
55
__author__ = "videodb"
66
__email__ = "[email protected]"

videodb/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,13 @@ def upload(
266266
) -> Union[Video, Audio, Image, None]:
267267
"""Upload a file.
268268
269-
The method automatically detects if ``source``/``file_path`` is a URL
270-
or a local path when only one of ``file_path`` or ``url`` is provided.
271-
272269
:param str source: Local path or URL of the file to upload (optional)
273270
:param MediaType media_type: MediaType object (optional)
274271
:param str name: Name of the file (optional)
275272
:param str description: Description of the file (optional)
276273
:param str callback_url: URL to receive the callback (optional)
277-
:param str file_path: Path to the file to upload (optional)
278-
:param str url: URL of the file to upload (optional)
274+
:param str file_path: Path to the file to upload (optional)
275+
:param str url: URL of the file to upload (optional)
279276
:return: :class:`Video <Video>`, or :class:`Audio <Audio>`, or :class:`Image <Image>` object
280277
:rtype: Union[ :class:`videodb.video.Video`, :class:`videodb.audio.Audio`, :class:`videodb.image.Image`]
281278
"""

videodb/collection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ def upload(
438438
) -> Union[Video, Audio, Image, None]:
439439
"""Upload a file to the collection.
440440
441-
The method automatically detects if ``source``/``file_path`` is a URL
442-
or a local path when only one of ``file_path`` or ``url`` is provided.
443-
444441
:param str source: Local path or URL of the file to be uploaded
445442
:param MediaType media_type: MediaType object (optional)
446443
:param str name: Name of the file (optional)

videodb/video.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,51 @@ def index_spoken_words(
300300
show_progress=True,
301301
)
302302

303+
def index_spoken_content(
304+
self,
305+
language_code: Optional[str] = None,
306+
force: bool = False,
307+
callback_url: str = None,
308+
) -> None:
309+
"""Semantic indexing of spoken words in the video.
310+
311+
:param str language_code: (optional) Language code of the video
312+
:param bool force: (optional) Force to index the video
313+
:param str callback_url: (optional) URL to receive the callback
314+
:raises InvalidRequestError: If the video is already indexed
315+
:return: None if the indexing is successful
316+
:rtype: None
317+
"""
318+
self._connection.post(
319+
path=f"{ApiPath.video}/{self.id}/{ApiPath.index}/spoken_content",
320+
data={
321+
"index_type": IndexType.spoken_word,
322+
"language_code": language_code,
323+
"force": force,
324+
"callback_url": callback_url,
325+
},
326+
show_progress=True,
327+
)
328+
329+
def index_visual_content(
330+
self,
331+
prompt: Optional[str] = None,
332+
callback_url: Optional[str] = None,
333+
) -> Optional[str]:
334+
"""Index the visual content of the video.
335+
"""
336+
visual_content_index_data = self._connection.post(
337+
path=f"{ApiPath.video}/{self.id}/{ApiPath.index}/visual_content",
338+
data={
339+
"prompt": prompt,
340+
"callback_url": callback_url,
341+
},
342+
)
343+
if not visual_content_index_data:
344+
return None
345+
return visual_content_index_data.get("scene_index_id")
346+
347+
303348
def get_scenes(self) -> Union[list, None]:
304349
"""
305350
.. deprecated:: 0.2.0

0 commit comments

Comments
 (0)