Skip to content

Fix/analyser output conversion - #66

Merged
omgate234 merged 6 commits into
releasefrom
fix/analyser-output-conversion
Aug 5, 2026
Merged

omgate234 merged 6 commits into
releasefrom
fix/analyser-output-conversion

Conversation

@omgate234

Copy link
Copy Markdown
Collaborator

Pull Request

Description:
Parity fixes aligning Video legacy search and analyzer output with videodb-python, released as 0.3.1.

Three problems surfaced after the Indexing v2 merge (#63):

  1. Understanding.getAnalyzerOutput() ran the default camelCase response conversion, renaming the server's scene_id to sceneId. The index endpoint does not recognize sceneId, so feeding analyzer output back into Video.index() as a source was broken.
  2. Video.search({ indexId }) threw "Cannot mix legacy search params" because the singular indexId was listed as an unsupported selector, when it should route to legacySearch()videodb-python's unsupported_params holds index_ids, not index_id.
  3. The legacy SemanticSearch payload omitted dynamic_score_percentage and filter when unset, whereas videodb-python always sends them (null / []). Omission changed server-side ranking, so identical calls returned different results between the two SDKs.

The legacy path also had no way to target a specific scene index, and the pre-v2 positional search() signature no longer routed to legacy.

Changes:

  • getAnalyzerOutput() passes { convert: false } so the server's raw snake_case keys survive the round-trip back into Video.index()
  • indexId moved from unsupported to oldParams in Video.search() — it now routes to legacySearch() instead of throwing; error message updated to indexName/indexNames/indexIds
  • SemanticSearch legacy request builder always emits dynamic_score_percentage (default null) and filter (default [])
  • sceneIndexId and algorithm added to the SearchBase type and emitted as scene_index_id / algorithm by all four legacy request builders (Scene, Semantic, Keyword, LLM)
  • legacySearch() accepts sceneIndexId, indexId (alias — explicit sceneIndexId wins), and algorithm; search() forwards all three when it routes to legacy
  • Video.search() re-accepts the pre-v2 fully positional signature (query, searchType, indexType, resultThreshold, scoreThreshold, dynamicScorePercentage, filter, sortDocsOn) and folds it into an options object, forcing legacy routing — mirrors videodb-python's has_old = bool(args)
  • stitch, rerank, rerankParams added to VideoSearchOptions and treated as legacy triggers
  • scoreThreshold is deliberately not a keyword legacy trigger (it is shared by both paths); it is now forwarded to the Search V2 payload as score_threshold

Note: the diff against release also shows a .github/workflows/release-package.yml reorder (publish before tag/GitHub release). That is not part of this PR — it landed on main via #65 and only appears because release is behind. Only the three commits above (7616537, 7653e65, ac2a5b6) are new here.

Related Issues:

Testing:
No automated tests added; test/index.spec.ts requires live API credentials, so the following were exercised manually against a real collection:

  • getAnalyzerOutput() → verify the returned payload still contains scene_id (not sceneId), then pass it straight into Video.index() as a source and confirm the index job is accepted.
  • video.search(query, { indexId }) → confirm it no longer throws and hits the legacy endpoint.
  • video.search(query, { sceneIndexId, algorithm }) and legacySearch(..., sceneIndexId, indexId, algorithm) → confirm scene_index_id / algorithm appear on the wire for all four search types.
  • Same semantic query run through both this SDK and videodb-python → result sets and ordering should now match (this is the dynamic_score_percentage / filter fix; regressions here are silent, so compare actual results, not just HTTP 200).
  • Re-test required: anything calling Video.search(). Routing between legacy and Search V2 changed — indexId now routes to legacy instead of throwing, positional calls force legacy, and scoreThreshold alone no longer forces legacy. Confirm existing v2 callers that pass scoreThreshold still reach the v2 endpoint.
  • Old positional call sites (search(q, 'semantic', 'spoken_word', 50)) → confirm they compile and route to legacy.

Checklist:

  • Code follows project coding standards
  • Tests have been added or updated
  • Code Review
  • Manual test after merge
  • All checks passed

@omgate234
omgate234 merged commit 71c89dc into release Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant