Skip to content
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.2.4] (2026-03-26)

### Added

- `sortDocsOn` parameter in `Collection.search()` and `Video.search()` to sort docs by "score" or "start"
- `modelConfig` parameter in `Scene.describe()` for custom model configuration
- `Video.update()` method to update video metadata (currently supports `name`)

### Changed

- `Video.name` is no longer readonly (required for `update()`)
- Updated capture binary to v0.3.0
- Bumped version to 0.2.4

---

## [0.2.3] (2026-03-18)

### Changed
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "videodb",
"version": "0.2.3",
"version": "0.2.4",
"description": "A NodeJS wrapper for VideoDB's API written in TypeScript",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,11 +40,11 @@
},
"binaryConfig": {
"baseUrl": "https://artifacts.videodb.io/capture",
"version": "0.2.10",
"version": "0.3.0",
"checksums": {
"darwin-arm64": "fc4be7de94153aa9f492b014db7b4f7378e45c3c6f1b5f3f838c2c007bde832f",
"darwin-x64": "bdfc3aa33a961ff532a99639ea95c181d51baee74a1eda555598ce45c30908ac",
"win32-x64": "3f9b9a355edc54dd06cef051b0ec7ed55df6beef6eb9e299fa6ba5f02ba3a50a"
"darwin-arm64": "4cf3ffadab2e3951819547086ddbad6f6fe2976a35590882a5967fa4ee30a4b7",
"darwin-x64": "8e9d2b44bb70bea48f172ca0edb34a5f699b226ff7a795aaf8e5011499596150",
"win32-x64": "2f47eac709c5852661ec6d073fb3691800e208a348c9d6cad61841d26eea89f4"
}
},
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/capture/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export class RecorderInstaller {
// Default binary config - can be overridden or loaded from package.json
this.binaryConfig = binaryConfig || {
baseUrl: 'https://artifacts.videodb.io/capture',
version: '0.2.10',
version: '0.3.0',
checksums: {
'darwin-x64': 'bdfc3aa33a961ff532a99639ea95c181d51baee74a1eda555598ce45c30908ac',
'darwin-arm64': 'fc4be7de94153aa9f492b014db7b4f7378e45c3c6f1b5f3f838c2c007bde832f',
'win32-x64': '3f9b9a355edc54dd06cef051b0ec7ed55df6beef6eb9e299fa6ba5f02ba3a50a',
'darwin-x64': '8e9d2b44bb70bea48f172ca0edb34a5f699b226ff7a795aaf8e5011499596150',
'darwin-arm64': '4cf3ffadab2e3951819547086ddbad6f6fe2976a35590882a5967fa4ee30a4b7',
'win32-x64': '2f47eac709c5852661ec6d073fb3691800e208a348c9d6cad61841d26eea89f4',
},
};

Expand Down
3 changes: 3 additions & 0 deletions src/core/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export class Collection implements ICollection {
* @param scoreThreshold - [optional] Score Threshold
* @param dynamicScorePercentage - [optional] Percentage of dynamic score to consider
* @param filter - [optional] Additional metadata filters
* @param sortDocsOn - [optional] Sort docs within each video by "score" or "start"
* @param namespace - [optional] Search namespace ("rtstream" to search RTStreams)
* @param sceneIndexId - [optional] Filter by specific scene index
* @returns SearchResult or RTStreamSearchResult object
Expand All @@ -250,6 +251,7 @@ export class Collection implements ICollection {
scoreThreshold?: number,
dynamicScorePercentage?: number,
filter?: Array<Record<string, unknown>>,
sortDocsOn?: string,
namespace?: string,
sceneIndexId?: string
): Promise<SearchResult | RTStreamSearchResult> => {
Expand Down Expand Up @@ -302,6 +304,7 @@ export class Collection implements ICollection {
scoreThreshold: scoreThreshold,
dynamicScorePercentage: dynamicScorePercentage,
filter: filter,
sortDocsOn: sortDocsOn,
});
return results;
};
Expand Down
3 changes: 2 additions & 1 deletion src/core/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ export class Scene {
this.#vhttp = http;
}

public async describe(prompt?: string, modelName?: string): Promise<string> {
public async describe(prompt?: string, modelName?: string, modelConfig?: Record<string, unknown>): Promise<string> {
const response = await this.#vhttp.post<{ description: string }, object>(
[ApiPath.video, this.videoId, ApiPath.scene, this.id, ApiPath.describe],
{
prompt,
model_name: modelName,
model_config: modelConfig,
}
);
this.description = response.data.description;
Expand Down
3 changes: 3 additions & 0 deletions src/core/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class SemanticSearch
if (data.filter !== undefined) {
reqData.filter = data.filter;
}
if (data.sortDocsOn !== undefined) {
reqData.sort_docs_on = data.sortDocsOn;
}
return reqData;
};

Expand Down
22 changes: 20 additions & 2 deletions src/core/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Video implements IVideo {
public readonly id: string;
public readonly collectionId: string;
public readonly length: string;
public readonly name: string;
public name: string;
public readonly description?: string;
public readonly size: string;
public readonly streamUrl: string;
Expand Down Expand Up @@ -112,6 +112,7 @@ export class Video implements IVideo {
* @param scoreThreshold - [optional] Score Threshold
* @param dynamicScorePercentage - [optional] Percentage of dynamic score to consider
* @param filter - [optional] Additional metadata filters
* @param sortDocsOn - [optional] Sort docs within each video by "score" or "start"
*/
public search = async (
query: string,
Expand All @@ -120,7 +121,8 @@ export class Video implements IVideo {
resultThreshold?: number,
scoreThreshold?: number,
dynamicScorePercentage?: number,
filter?: Array<Record<string, unknown>>
filter?: Array<Record<string, unknown>>,
sortDocsOn?: string
) => {
const s = new SearchFactory(this.#vhttp);
const searchFunc = s.getSearch(searchType ?? DefaultSearchType);
Expand All @@ -133,10 +135,26 @@ export class Video implements IVideo {
scoreThreshold: scoreThreshold,
dynamicScorePercentage: dynamicScorePercentage,
filter: filter,
sortDocsOn: sortDocsOn,
});
return results;
};

/**
* Update the video's metadata
* @param options - Fields to update
* @param options.name - New name for the video
*/
public update = async (options: { name?: string }) => {
const data: Record<string, unknown> = {};
if (options.name !== undefined) data.name = options.name;
const res = await this.#vhttp.patch<{ id: string; name: string }, typeof data>(
[video, this.id],
data
);
if (options.name !== undefined) this.name = res.data.name ?? options.name;
};

/**
* Returns an empty promise that resolves when the video is deleted
* @returns A promise that resolves when delete is successful
Expand Down
1 change: 1 addition & 0 deletions src/types/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type SearchBase = {
scoreThreshold?: number;
dynamicScorePercentage?: number;
filter?: Array<Record<string, unknown>>;
sortDocsOn?: string;
};

export type SemanticSearchBase = SearchBase;
Expand Down
Loading