Class: ChromaClient#
ChromaClient.ChromaClient
Constructors#
constructor#
• new ChromaClient(params?
)
Creates a new ChromaClient instance.
Parameters#
Name | Type | Description |
---|---|---|
params | ChromaClientParams | The parameters for creating a new client |
Example
Methods#
countCollections#
â–¸ countCollections(): Promise
<number
>
Counts all collections.
Returns#
Promise
<number
>
A promise that resolves to the number of collections.
Throws
If there is an issue counting the collections.
Example
createCollection#
â–¸ createCollection(params
): Promise
<Collection
>
Creates a new collection with the specified properties.
Parameters#
Name | Type | Description |
---|---|---|
params | CreateCollectionParams | The parameters for creating a new collection. |
Returns#
Promise
<Collection
>
A promise that resolves to the created collection.
Throws
If the client is unable to connect to the server.
Throws
If there is an issue creating the collection.
Example
deleteCollection#
â–¸ deleteCollection(params
): Promise
<void
>
Deletes a collection with the specified name.
Parameters#
Name | Type | Description |
---|---|---|
params | DeleteCollectionParams | The parameters for deleting a collection. |
Returns#
Promise
<void
>
A promise that resolves when the collection is deleted.
Throws
If there is an issue deleting the collection.
Example
getCollection#
â–¸ getCollection(params
): Promise
<Collection
>
Gets a collection with the specified name.
Parameters#
Name | Type | Description |
---|---|---|
params | GetCollectionParams | The parameters for getting a collection. |
Returns#
Promise
<Collection
>
A promise that resolves to the collection.
Throws
If there is an issue getting the collection.
Example
getOrCreateCollection#
â–¸ getOrCreateCollection(params
): Promise
<Collection
>
Gets or creates a collection with the specified properties.
Parameters#
Name | Type | Description |
---|---|---|
params | CreateCollectionParams | The parameters for creating a new collection. |
Returns#
Promise
<Collection
>
A promise that resolves to the got or created collection.
Throws
If there is an issue getting or creating the collection.
Example
heartbeat#
â–¸ heartbeat(): Promise
<number
>
Returns a heartbeat from the Chroma API.
Returns#
Promise
<number
>
A promise that resolves to the heartbeat from the Chroma API.
Throws
If the client is unable to connect to the server.
Example
listCollections#
▸ listCollections(«destructured»?
): Promise
<CollectionParams
[]>
Lists all collections.
Parameters#
Name | Type |
---|---|
«destructured» | ListCollectionsParams |
Returns#
Promise
<CollectionParams
[]>
A promise that resolves to a list of collection names.
Throws
If there is an issue listing the collections.
Example
reset#
â–¸ reset(): Promise
<boolean
>
Resets the state of the object by making an API call to the reset endpoint.
Returns#
Promise
<boolean
>
A promise that resolves when the reset operation is complete.
Throws
If the client is unable to connect to the server.
Throws
If the server experienced an error while the state.
Example
version#
â–¸ version(): Promise
<string
>
Returns the version of the Chroma API.
Returns#
Promise
<string
>
A promise that resolves to the version of the Chroma API.
Throws
If the client is unable to connect to the server.
Example