Skip to content

Commit ed688f0

Browse files
itaismithSicheng-Pan
authored andcommitted
Add SparseVector to JS metadata values
1 parent 6f7ec0d commit ed688f0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

clients/new-js/packages/chromadb/scripts/gen-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const main = async () => {
3636

3737
// Fix the HashMap type to include null and remove duplicate number
3838
typesContent = typesContent.replace(
39-
/export type HashMap = \{\s*\[key: string\]: boolean \| number \| number \| string;\s*\};/,
40-
"export type HashMap = {\n [key: string]: boolean | number | string | null;\n};",
39+
/export type HashMap = \{\s*\[key: string\]: boolean \| number \| number \| string \| SparseVector;\s*};/,
40+
"export type HashMap = {\n [key: string]: boolean | number | string | SparseVector | null;\n};",
4141
);
4242

4343
await writeFile(typesPath, typesContent);

clients/new-js/packages/chromadb/src/api/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export type GetUserIdentityResponse = {
131131
};
132132

133133
export type HashMap = {
134-
[key: string]: boolean | number | number | string | SparseVector;
134+
[key: string]: boolean | number | string | SparseVector | null;
135135
};
136136

137137
export type HeartbeatResponse = {

clients/new-js/packages/chromadb/src/types.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GetUserIdentityResponse, Include } from "./api";
1+
import { GetUserIdentityResponse, Include, SparseVector } from "./api";
22

33
/**
44
* User identity information including tenant and database access.
@@ -11,14 +11,17 @@ export type UserIdentity = GetUserIdentityResponse;
1111
*/
1212
export type CollectionMetadata = Record<
1313
string,
14-
boolean | number | string | null
14+
boolean | number | string | SparseVector | null
1515
>;
1616

1717
/**
1818
* Metadata that can be associated with individual records.
1919
* Values must be boolean, number, or string types.
2020
*/
21-
export type Metadata = Record<string, boolean | number | string | null>;
21+
export type Metadata = Record<
22+
string,
23+
boolean | number | string | SparseVector | null
24+
>;
2225

2326
/**
2427
* Base interface for record sets containing optional fields.

0 commit comments

Comments
 (0)