Skip to content

Commit f8f5ed0

Browse files
authored
Merge pull request video-db#28 from video-db/ankit/add-title-search
Ankit/add title search
2 parents c67327e + 668988a commit f8f5ed0

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

videodb/__about__.py

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

33

4-
__version__ = "0.2.5"
4+
__version__ = "0.2.6"
55
__title__ = "videodb"
66
__author__ = "videodb"
77
__email__ = "[email protected]"

videodb/_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class SearchType:
1515
semantic = "semantic"
1616
keyword = "keyword"
1717
scene = "scene"
18+
llm = "llm"
1819

1920

2021
class IndexType:
@@ -68,6 +69,7 @@ class ApiPath:
6869
describe = "describe"
6970
storage = "storage"
7071
download = "download"
72+
title = "title"
7173

7274

7375
class Status:

videodb/collection.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ def search(
117117
dynamic_score_percentage=dynamic_score_percentage,
118118
)
119119

120+
def search_title(self, query) -> List[Video]:
121+
search_data = self._connection.post(
122+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.search}/{ApiPath.title}",
123+
data={
124+
"query": query,
125+
"search_type": SearchType.llm,
126+
},
127+
)
128+
return [
129+
{"video": Video(self._connection, **result.get("video"))}
130+
for result in search_data
131+
]
132+
120133
def upload(
121134
self,
122135
file_path: str = None,

0 commit comments

Comments
 (0)