Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
181bf59
feat: add indexing v2
ankit-v2-3 Jun 23, 2026
d32073d
fix: formatting
ankit-v2-3 Jun 23, 2026
c902768
feat: add search v2 SDK interface
sankalp-videodb Jun 23, 2026
b5053e4
chore: improve legacy search warning
sankalp-videodb Jun 23, 2026
c0acb08
Revert "chore: improve legacy search warning"
sankalp-videodb Jun 23, 2026
e64f667
feat: understanding module
0xrohitgarg Jun 24, 2026
b9b6f26
Allow semantic_search without index_names
sankalp-videodb Jun 25, 2026
6a813e4
fix: rename start, end and segment_id
ankit-v2-3 Jun 26, 2026
03510cb
Add ask API
sankalp-videodb Jun 26, 2026
a971573
fix: extract_type
ankit-v2-3 Jun 26, 2026
ba4443e
Merge branch 'feat/add-indexing-v2' of https://github.com/video-db/vi…
ankit-v2-3 Jun 26, 2026
8d3857c
fix: add error state
ankit-v2-3 Jun 26, 2026
84fb8a2
fix: inline
ankit-v2-3 Jun 29, 2026
398109b
Add explicit index id search params
sankalp-videodb Jun 30, 2026
642659c
Add RTStream v2 understand SDK methods
lalit-videodb Jul 2, 2026
d7cb101
Merge pull request #80 from video-db/feat/rtstream-understand
lalit-videodb Jul 2, 2026
7adbc3f
Add RTStream v2 index SDK methods
lalit-videodb Jul 2, 2026
66bd95e
Merge pull request #81 from video-db/feat/rtstream-understand
lalit-videodb Jul 2, 2026
4697c61
Add index alert methods to RTStreamIndex
lalit-videodb Jul 2, 2026
50e00e2
Merge pull request #82 from video-db/feat/rtstream-understand
lalit-videodb Jul 2, 2026
d1643da
fix understanding termainl status
0xrohitgarg Jul 2, 2026
f91d39b
Support DeepSearch sessions in SearchResponse
sankalp-videodb Jul 7, 2026
d1c0a92
Merge pull request #85 from video-db/feat/search-v2-deepsearch-sdk
sankalp-videodb Jul 7, 2026
190601a
Show DeepSearch clarification in SearchResponse repr
sankalp-videodb Jul 7, 2026
5e8b3f8
feat(search-v2): add search config trace support
sankalp-videodb Jul 9, 2026
b9e5e08
Merge pull request #87 from video-db/sdk-search-v2-include-trace
sankalp-videodb Jul 9, 2026
2cf253f
fix: accept analyzer as a source
ankit-v2-3 Jul 16, 2026
a6fe48c
fix: to_index_source
ankit-v2-3 Jul 16, 2026
1dd29bf
fix: temporal records
ankit-v2-3 Jul 16, 2026
d855fbc
Add Sandbox and compute changes
rohitgxrg Jul 21, 2026
6cdf03a
feat: add index refresh
ankit-v2-3 Jul 21, 2026
d3fc5a2
Merge branch 'feat/add-indexing-v2' of https://github.com/video-db/vi…
ankit-v2-3 Jul 21, 2026
095e5a7
Remove Search V2 progress bars
sankalp-videodb Jul 21, 2026
925a831
Merge pull request #89 from video-db/search-v2-remove-progress-bars
sankalp-videodb Jul 21, 2026
12778b9
docs: remove comments
ankit-v2-3 Jul 22, 2026
5564c24
fix: constants
ankit-v2-3 Jul 22, 2026
e6d01a9
build: update version
ankit-v2-3 Jul 22, 2026
e0dc0a4
fix: remove fts
ankit-v2-3 Jul 22, 2026
ed927fd
fix: remove fts
ankit-v2-3 Jul 22, 2026
900117d
Add Search V2 migration compatibility
sankalp-videodb Jul 22, 2026
a4a8757
Merge pull request #92 from video-db/feat/search-v2-migration-compat
sankalp-videodb Jul 22, 2026
76e260c
Merge pull request #93 from video-db/feat/add-indexing-v2
ankit-v2-3 Jul 22, 2026
d38cf8a
Revert sandbox and compute SDK changes
0xrohitgarg Jul 22, 2026
5b8d374
Merge branch 'feat/add-indexing-v2' of github.com:video-db/videodb-py…
0xrohitgarg Jul 22, 2026
b210701
Merge pull request #95 from video-db/feat/add-indexing-v2
0xrohitgarg Jul 22, 2026
b5be019
Keep SDK warning docs server-owned
sankalp-videodb Jul 22, 2026
fb3b651
Remove internal Search V2 migration warning tests
sankalp-videodb Jul 22, 2026
94ef256
Hide internal DeepSearch option from SDK errors
sankalp-videodb Jul 22, 2026
c5d387d
Use server-owned Search V2 warning copy
sankalp-videodb Jul 22, 2026
8c50ac6
Route legacy search tuning options correctly
sankalp-videodb Jul 22, 2026
14ad49d
Document Search V2 SDK methods
sankalp-videodb Jul 22, 2026
b1aea00
Merge pull request #96 from video-db/feat/search-v2-migration-compat
sankalp-videodb Jul 22, 2026
0ac1b4a
fix: move constants to constants.py
ankit-v2-3 Jul 22, 2026
99b72d9
Merge pull request #97 from video-db/ankit/move-constants
ankit-v2-3 Jul 22, 2026
5170332
Merge pull request #98 from video-db/feat/add-indexing-v2
ankit-v2-3 Jul 22, 2026
8436dee
Simplify analyzer normalization
0xrohitgarg Jul 22, 2026
a80232f
Remove understanding normalization tests
0xrohitgarg Jul 22, 2026
7f2c211
Merge pull request #99 from video-db/feat/add-indexing-v2
0xrohitgarg Jul 22, 2026
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
70 changes: 70 additions & 0 deletions tests/test_search_legacy_routing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import warnings

from videodb.collection import Collection
from videodb.video import Video
import videodb.search as search_module


class FakeConnection:
def __init__(self, response=None):
self.posts = []
self.response = response or {"results": []}

def post(self, path, data=None, **kwargs):
self.posts.append({"path": path, "data": data or {}, "kwargs": kwargs})
return self.response


def setup_function():
search_module._RESPONSE_WARNING_EMITTED.clear()


def test_video_search_routes_stitch_rerank_options_to_legacy_endpoint_without_local_warning():
conn = FakeConnection()
video = Video(conn, id="video-1", collection_id="collection-1")

with warnings.catch_warnings(record=True) as emitted:
warnings.simplefilter("always")
result = video.search(
"find moments",
stitch=False,
rerank=True,
rerank_params={"top_k": 3},
)

assert len(emitted) == 0
assert result.warnings == []
assert len(conn.posts) == 1
assert conn.posts[0]["path"] == "video/video-1/search"
assert conn.posts[0]["data"]["stitch"] is False
assert conn.posts[0]["data"]["rerank"] is True
assert conn.posts[0]["data"]["rerank_params"] == {"top_k": 3}


def test_collection_search_routes_stitch_rerank_options_to_legacy_endpoint():
conn = FakeConnection()
collection = Collection(conn, id="collection-1")

collection.search(
"find moments",
stitch=False,
rerank=True,
rerank_params={"rank_fields": ["text"]},
)

assert len(conn.posts) == 1
assert conn.posts[0]["path"] == "collection/collection-1/search"
assert conn.posts[0]["data"]["stitch"] is False
assert conn.posts[0]["data"]["rerank"] is True
assert conn.posts[0]["data"]["rerank_params"] == {"rank_fields": ["text"]}


def test_video_search_still_routes_to_v2_when_no_legacy_params_are_present():
conn = FakeConnection({"response_type": "shots", "results": []})
video = Video(conn, id="video-1", collection_id="collection-1")

video.search("find moments")

assert len(conn.posts) == 1
assert conn.posts[0]["path"] == "video/video-1/search/v2"
assert conn.posts[0]["data"] == {"query": "find moments"}
2 changes: 1 addition & 1 deletion videodb/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



__version__ = "0.4.5"
__version__ = "0.5.0"
__title__ = "videodb"
__author__ = "videodb"
__email__ = "contact@videodb.io"
Expand Down
11 changes: 11 additions & 0 deletions videodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from videodb._constants import (
VIDEO_DB_API,
IndexType,
IndexCapability,
FieldGroup,
SceneExtractionType,
MediaType,
SearchType,
Expand All @@ -25,6 +27,8 @@
RTStreamChannelType,
)
from videodb.client import Connection
from videodb.search import AskResponse, SearchResponse, SearchResult
from videodb.understanding import Understanding, UnderstandingAnalyzer
from videodb.capture_session import CaptureSession
from videodb.websocket_client import WebSocketConnection
from videodb.capture import CaptureClient, Channel, AudioChannel, VideoChannel, Channels, ChannelList
Expand Down Expand Up @@ -53,7 +57,14 @@
"AuthenticationError",
"InvalidRequestError",
"IndexType",
"IndexCapability",
"FieldGroup",
"SearchError",
"SearchResult",
"SearchResponse",
"AskResponse",
"Understanding",
"UnderstandingAnalyzer",
"play_stream",
"build_iframe_embed_code",
"MediaType",
Expand Down
29 changes: 29 additions & 0 deletions videodb/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ class IndexType:
scene = "scene"


class IndexCapability:
"""Retrieval capabilities an index can be built for (``use_for``)."""

semantic = "semantic"
query = "query"
aggregate = "aggregate"


class FieldGroup:
"""Field groups that map artifact fields to retrieval capabilities."""

semantic = "semantic"
filter = "filter"
aggregate = "aggregate"
sort = "sort"


class SceneExtractionType:
shot_based = "shot"
time_based = "time"
Expand Down Expand Up @@ -80,7 +97,14 @@ class ApiPath:
upload_url = "upload_url"
transcription = "transcription"
index = "index"
indexes = "indexes"
records = "records"
understand = "understand"
search = "search"
ask = "ask"
semantic_search = "semantic-search"
query = "query"
aggregate = "aggregate"
compile = "compile"
workflow = "workflow"
timeline = "timeline"
Expand Down Expand Up @@ -123,6 +147,11 @@ class Status:
in_progress = "in progress"


INDEX_TERMINAL_STATUSES = {"ready", "failed"}
UNDERSTANDING_TERMINAL_STATUSES = {"done", "failed"}
ANALYZER_TERMINAL_STATUSES = {"done", "failed", "skipped", "cancelled"}


class MeetingStatus:
initializing = "initializing"
processing = "processing"
Expand Down
Loading
Loading