Skip to content

Commit

Permalink
Merge pull request #28 from video-db/ankit/add-title-search
Browse files Browse the repository at this point in the history
Ankit/add title search
  • Loading branch information
ankit-v2-3 authored Nov 6, 2024
2 parents c67327e + 668988a commit f8f5ed0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion videodb/__about__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" About information for videodb sdk"""


__version__ = "0.2.5"
__version__ = "0.2.6"
__title__ = "videodb"
__author__ = "videodb"
__email__ = "[email protected]"
Expand Down
2 changes: 2 additions & 0 deletions videodb/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SearchType:
semantic = "semantic"
keyword = "keyword"
scene = "scene"
llm = "llm"


class IndexType:
Expand Down Expand Up @@ -68,6 +69,7 @@ class ApiPath:
describe = "describe"
storage = "storage"
download = "download"
title = "title"


class Status:
Expand Down
13 changes: 13 additions & 0 deletions videodb/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ def search(
dynamic_score_percentage=dynamic_score_percentage,
)

def search_title(self, query) -> List[Video]:
search_data = self._connection.post(
path=f"{ApiPath.collection}/{self.id}/{ApiPath.search}/{ApiPath.title}",
data={
"query": query,
"search_type": SearchType.llm,
},
)
return [
{"video": Video(self._connection, **result.get("video"))}
for result in search_data
]

def upload(
self,
file_path: str = None,
Expand Down

0 comments on commit f8f5ed0

Please sign in to comment.