Skip to content

Commit 15c01f0

Browse files
committed
feat: add title search.
1 parent c67327e commit 15c01f0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ def search(
106106
score_threshold: Optional[float] = None,
107107
dynamic_score_percentage: Optional[float] = None,
108108
) -> SearchResult:
109+
if search_type == SearchType.llm:
110+
search_data = self._connection.post(
111+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.search}/{ApiPath.title}",
112+
data={
113+
"query": query,
114+
"search_type": search_type,
115+
},
116+
)
117+
return [
118+
Video(self._connection, **result.get("video")) for result in search_data
119+
]
120+
109121
search = SearchFactory(self._connection).get_search(search_type)
110122
return search.search_inside_collection(
111123
collection_id=self.id,

0 commit comments

Comments
 (0)