Skip to content

Commit

Permalink
Export Collection type directly
Browse files Browse the repository at this point in the history
  • Loading branch information
itaismith committed Dec 17, 2024
1 parent f16f832 commit a175587
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions clients/js/src/ChromaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class ChromaClient {
/**
* Lists all collections.
*
* @returns {Promise<CollectionType[]>} A promise that resolves to a list of collection names.
* @returns {Promise<string[]>} A promise that resolves to a list of collection names.
* @param {PositiveInteger} [params.limit] - Optional limit on the number of items to get.
* @param {PositiveInteger} [params.offset] - Optional offset on the items to get.
* @throws {Error} If there is an issue listing the collections.
Expand All @@ -304,7 +304,7 @@ export class ChromaClient {
* ```
*/
async listCollections({ limit, offset }: ListCollectionsParams = {}): Promise<
CollectionParams[]
string[]
> {
await this.init();
return (await this.api.listCollections(
Expand All @@ -313,7 +313,7 @@ export class ChromaClient {
limit,
offset,
this.api.options,
)) as CollectionParams[];
)) as string[];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export { ChromaClient } from "./ChromaClient";
export { AdminClient } from "./AdminClient";
export { CloudClient } from "./CloudClient";
export { Collection } from "./Collection";
export type { IEmbeddingFunction } from "./embeddings/IEmbeddingFunction";
export { OpenAIEmbeddingFunction } from "./embeddings/OpenAIEmbeddingFunction";
export { CohereEmbeddingFunction } from "./embeddings/CohereEmbeddingFunction";
Expand All @@ -14,7 +15,6 @@ export { OllamaEmbeddingFunction } from "./embeddings/OllamaEmbeddingFunction";
export type {
IncludeEnum,
GetParams,
CollectionType,
CollectionMetadata,
Embedding,
Embeddings,
Expand Down
7 changes: 0 additions & 7 deletions clients/js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ export type WhereDocument = {
| WhereDocument[];
};

export type CollectionType = {
name: string;
id: string;
metadata: Metadata | null;
configuration_json: any;
};

export type MultiGetResponse = {
ids: IDs;
embeddings: Embeddings | null;
Expand Down
4 changes: 2 additions & 2 deletions clients/js/test/collection.client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("collection operations", () => {
const [returnedCollection] = collections;

expect({
...returnedCollection,
returnedCollection,
configuration_json: undefined,
id: undefined,
}).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -80,7 +80,7 @@ describe("collection operations", () => {
expect(collections2).toHaveLength(1);
const [returnedCollection2] = collections2;
expect({
...returnedCollection2,
returnedCollection2,
configuration_json: undefined,
id: undefined,
}).toMatchInlineSnapshot(`
Expand Down

0 comments on commit a175587

Please sign in to comment.