Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ankit/add title search #28

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading