Fix/analyser output conversion - #66
Merged
Merged
Conversation
release `v0.3.0`
feat: publish before git tag push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description:
Parity fixes aligning
Videolegacy search and analyzer output withvideodb-python, released as0.3.1.Three problems surfaced after the Indexing v2 merge (#63):
Understanding.getAnalyzerOutput()ran the default camelCase response conversion, renaming the server'sscene_idtosceneId. The index endpoint does not recognizesceneId, so feeding analyzer output back intoVideo.index()as asourcewas broken.Video.search({ indexId })threw"Cannot mix legacy search params"because the singularindexIdwas listed as an unsupported selector, when it should route tolegacySearch()—videodb-python'sunsupported_paramsholdsindex_ids, notindex_id.SemanticSearchpayload omitteddynamic_score_percentageandfilterwhen unset, whereasvideodb-pythonalways 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 intoVideo.index()indexIdmoved fromunsupportedtooldParamsinVideo.search()— it now routes tolegacySearch()instead of throwing; error message updated toindexName/indexNames/indexIdsSemanticSearchlegacy request builder always emitsdynamic_score_percentage(defaultnull) andfilter(default[])sceneIndexIdandalgorithmadded to theSearchBasetype and emitted asscene_index_id/algorithmby all four legacy request builders (Scene, Semantic, Keyword, LLM)legacySearch()acceptssceneIndexId,indexId(alias — explicitsceneIndexIdwins), andalgorithm;search()forwards all three when it routes to legacyVideo.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 — mirrorsvideodb-python'shas_old = bool(args)stitch,rerank,rerankParamsadded toVideoSearchOptionsand treated as legacy triggersscoreThresholdis deliberately not a keyword legacy trigger (it is shared by both paths); it is now forwarded to the Search V2 payload asscore_thresholdNote: the diff against
releasealso shows a.github/workflows/release-package.ymlreorder (publish before tag/GitHub release). That is not part of this PR — it landed onmainvia #65 and only appears becausereleaseis behind. Only the three commits above (7616537,7653e65,ac2a5b6) are new here.Related Issues:
Testing:
No automated tests added;
test/index.spec.tsrequires live API credentials, so the following were exercised manually against a real collection:getAnalyzerOutput()→ verify the returned payload still containsscene_id(notsceneId), then pass it straight intoVideo.index()as asourceand 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 })andlegacySearch(..., sceneIndexId, indexId, algorithm)→ confirmscene_index_id/algorithmappear on the wire for all four search types.videodb-python→ result sets and ordering should now match (this is thedynamic_score_percentage/filterfix; regressions here are silent, so compare actual results, not just HTTP 200).Video.search(). Routing between legacy and Search V2 changed —indexIdnow routes to legacy instead of throwing, positional calls force legacy, andscoreThresholdalone no longer forces legacy. Confirm existing v2 callers that passscoreThresholdstill reach the v2 endpoint.search(q, 'semantic', 'spoken_word', 50)) → confirm they compile and route to legacy.Checklist: