99 Commits

Author SHA1 Message Date
calvintwr
35991bfe87 export IncludeEnum as it is required by #get and #query (#1167)
## Description of changes

The `IncludeEnum` enum is not exported, cause lint errors when using
`.get` or `.query`, as follows:

```js
const result = await collection.query({
    queryTexts: [query],
    // THIS LINE WILL PRODUCE LINT ERROR as it needs IncludeEnum.Distances etc.
    include: ['distances', 'documents', 'metadatas'],
    nResults: 2,
})
```

## Test plan

Nil

## Documentation Changes

Nil
2023-09-21 10:30:58 -07:00
Trayan Azarov
5436bd5de1 [ENH]: Support for $in and $nin metadata filters (#1151)
Refs: #1105

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - JS Client support for $in and $nin

## Test plan
*How are these changes tested?*

- [x] Tests pass locally `yarn test` for js

## Documentation Changes
TBD
2023-09-20 10:28:38 -07:00
Hammad Bashir
f3284f62b9 [RELEASE] JS 1.5.11 (#1161)
Releases Js 1.5.11
2023-09-19 09:34:03 -07:00
Trayan Azarov
aa0387a6d7 [BUG]: Added cohere version 6.x support in peer dependencies (#1156)
Refs: #1104

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Expanding Cohere version also to support 6.x This plays nice with the
rest of the ecosystem

## Test plan
*How are these changes tested?*

- [x] `yarn test` for js

## Documentation Changes
N/A
2023-09-19 09:14:16 -07:00
Jeff Huber
b930a862ba js 1.5.10 (#1155)
Release https://github.com/chroma-core/chroma/pull/1153
2023-09-18 21:18:25 -07:00
Trayan Azarov
9e05cb372a [BUG]: Fixing broken peer deps (#1153)
Refs: #1104

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Removed transformers and web-ai peer dependencies.

## Test plan
*How are these changes tested?*

- [ ] Manual testing - `mkdir testproject && cd testproject && npm init
-y && npm link chromadb && npm add langchain`


## Documentation Changes
N/A
2023-09-18 15:56:53 -07:00
Trayan Azarov
2b434b8266 [ENH]: JS Client Static Token support (#1114)
Refs: #1083

## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
- JS Client now supports Authorization, and X-Chroma-Token auths
supported
         - Tests and integration tests updated

## Test plan
*How are these changes tested?*

- [x] Tests pass locally `yarn test` for js

## Documentation Changes
TBD
2023-09-18 11:30:25 -07:00
Jeff Huber
a0a3c35217 bump JS to 1.5.9 (#1145)
Bump to release to 1.5.9 to release
https://github.com/chroma-core/chroma/pull/1142
2023-09-15 13:32:41 -07:00
Jacob Lee
d090ca6f6f Fix broken peer OpenAI dep dependency range (#1142)
https://semver.npmjs.com/

<img width="1362" alt="Screenshot 2023-09-13 at 3 51 28 PM"
src="https://github.com/chroma-core/chroma/assets/6952323/ab7752f2-9a82-4ea6-8a9b-f92b13b124b0">

<img width="1414" alt="Screenshot 2023-09-13 at 3 51 16 PM"
src="https://github.com/chroma-core/chroma/assets/6952323/c7761348-e499-4541-a775-b5436abff749">

npm strictly checks peer dep ranges, which means the `npm install` of
anything with a peer dep on Chroma was affected by this.
2023-09-15 10:13:30 -07:00
Jeff Huber
7d412aef8c [ENH] initial CLI (#1032)
This proposes an initial CLI

The CLI is installed when you installed `pip install chromadb`.

You then call the CLI with

`chroma run --path <persist_dir> --port <port>` where path and port are
optional.

This also adds `chroma help` and `chroma docs` as convenience links -
but I'm open to removing those.

To make this easy - I added `typer` (by the author of FastAPI). I'm not
sure this is the tool that we want to commit to for a fuller featured
CLI, but given the extremely minimal footprint of this - I don't think
it's a one way door.

<img width="1477" alt="Screenshot 2023-08-23 at 4 59 54 PM"
src="https://github.com/chroma-core/chroma/assets/891664/30374228-d303-41e1-8e9e-188b7f8532d4">

***

#### TODO
- [x] test in fresh env - i think i need to add `typer` as a req
- [ ] consider expanding the test to make sure the service is actually
running
- [x] hide the test option from the typer UI
- [x] linking to a getting started guide could be interesting at the top
of the logs
2023-09-11 20:49:25 -07:00
Jeff Huber
3241de7a6f update JS instructions (#960)
Improve develop instructions for the JS client

---------

Co-authored-by: Pascal M <11357019+perzeuss@users.noreply.github.com>
Co-authored-by: Hammad Bashir <HammadB@users.noreply.github.com>
2023-09-06 22:19:41 -07:00
hammadb
242d165554 [RELEASE] Release js 1.5.8 2023-09-05 17:21:09 -07:00
Hammad Bashir
c3075ef31a [RELEASE] Release JS 1.5.7 (#1090)
Release JS 1.5.7
2023-09-05 16:50:16 -07:00
Hammad Bashir
986fc38c98 [BLD] Add release automation for JS client (#1091)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Adds release automation for JS client. 

## Test plan
They will have to be tested after merging this PR

## Documentation Changes
Update the js client Develop guide for how to use this automation.
2023-09-05 15:04:31 -07:00
Trayan Azarov
6dd2d4af0b [ENH]: CIP-4: In and Not In Metadata Filters (#1081)
Cherry-picked from #1029

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Added support for `$in` and `$nin` metadata filters

> Note: See CIP in `docs/` or example notebook for more info

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python

## Documentation Changes
TBD

---------

Co-authored-by: Hammad Bashir <HammadB@users.noreply.github.com>
2023-09-05 10:42:01 -07:00
Pascal M
81ab0b1124 fix: use workaround for dynamic import (#956)
resolves #953

## Description of changes
 -  Bug fixes
- implement a workaround in
clients/js/src/embeddings/WebAIEmbeddingFunction.ts to resolve #953

## Test plan
At present, we lack a testing setup specifically tailored for a browser
environment. Implementing this would be a necessary step to implement
tests for changes in this branch.

I've tested it locally using this change:
https://github.com/jeffchuber/nextjs-chroma/pull/1/files
- http://localhost:3000/api/hello (node version) works fine
- http://localhost:3000 (browser version) works fine
2023-08-31 10:59:27 -07:00
Trayan Azarov
a640e8aecc [ENH]: OpenAI npm package v4 breaking changes (#1039)
Refs: #1038

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Added support for both v3 and v4 of the OpenAI node library

## Test plan

`yarn test` 

## Documentation Changes
TBD
2023-08-30 10:29:31 -07:00
Trayan Azarov
ffff00bb9c [ENH]: JS Client Support for Auth (#1050)
Refs: #1026

## Description of changes

*Summarize the changes made by this PR.*
	
 - New functionality
	 - Auth abstractions
	 - Basic auth supported

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `yarn test` for js (Regression)
- [x] Add new tests for auth

## Documentation Changes
Yes docs need to be updated to provide information how to configure auth
with the JS client.
2023-08-30 10:29:20 -07:00
Hammad Bashir
fd014edf05 [BUG] Add dep fix for pydantic in thin client (#1033)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- #799 introduced a max version for pydantic but this change was not
propagated to the thin client. This makes the same change in the thin
client.
 - New functionality
	 - ...

## Test plan
Existing tests for client

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js

## Documentation Changes
None
2023-08-28 22:36:46 +00:00
Pascal M
f8186ff093 feat: support conditional exports in js client (#963)
## Description of changes
Currently not all bundlers will chose the correct CJS/ESM build when
importing the js client because we don't define them using
[conditional-exports](https://nodejs.org/api/packages.html#conditional-exports).
This change adds the required configuration in the package.json to fix
that.

 - Improvements & Bug fixes
	 - support conditional exports in js client


## Test plan
I have tested this manually. We have a Next.js setup which throws an
error with v1.5.6, we make use of that to detect which build (cjs/esm)
nextjs tries to load. In both cases we expect an error with the path
from which nextjs loads the module.


### Reproduce the issue
- checkout
2df1a21686
- run yarn && yarn dev
- open http://localhost:3000/
- you should see the following error in the browser
```
Failed to compile

./node_modules/chromadb/dist/main/embeddings/WebAIEmbeddingFunction.js:157:0
Module not found: Can't resolve '@visheratin/web-ai'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/chromadb/dist/main/index.js
./src/app/page.js

This error occurred during the build process and can only be dismissed by fixing the error.
```
Nextjs loads the cjs build from `dist/main`.

### Confirm the change resolves the issue
- checkout
2df1a21686
- remove current chromadb package (1.5.6) using `yarn remove chromadb`
- install chromadb client with the [change in this
pr](450159ec23)
using package linking or using verdaccio
- open http://localhost:3000/
- you should see the following error in the browser
```
Failed to compile

./node_modules/chromadb/dist/module/embeddings/WebAIEmbeddingFunction.js:131:0
Module not found: Can't resolve '@visheratin/web-ai'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/chromadb/dist/module/index.js
./src/app/page.js

This error occurred during the build process and can only be dismissed by fixing the error.
```
Nextjs now loads the esm build from `dist/module`

## Documentation Changes
I added a reference to
https://nodejs.org/api/packages.html#conditional-exports in the commit
message
2023-08-16 14:55:03 -07:00
Alexander Visheratin
221bdfa913 Web AI embedder fixes (#929)
## Description of changes

After the recent changes in the Web AI structure, the embedder function
became invalid because of different imports and because the browser
version of the library is only ESM, as mentioned
[here](https://github.com/chroma-core/chroma/issues/824#issuecomment-1649761279).

To fix the issue, I updated the import paths and changed the `require`
statements to `import` for the browser version of the function.

**Important note:**

When using the embedded in the browser, you should import
`chromadb/dist/module` because the [browser
version](https://www.npmjs.com/package/@visheratin/web-ai) of Web AI is
ESM-only.
For Node.js, you can use regular `chromadb` import because [Node.js
version](https://www.npmjs.com/package/@visheratin/web-ai-node) of the
library is CJS.

Additionally, because Web AI since recently supports multimodal
embeddings, I added building multimodal embeddings using CLIP-base.

## Test plan

I tested the changes locally for both browser and Node.js. The built
`chromadb` package if someone wants to test it in their projects, is
available
[here](https://drive.google.com/file/d/1cNLsHGd1VmiFiamvsEaMVGA7ng56QQKG/view?usp=sharing).

## Documentation Changes

There likely will be needed changes regarding the multimodal
functionality.
2023-08-07 14:54:09 -07:00
Jeff Huber
608d01ed98 clean up JS API, remove increment_index, createIndex and rawSql (#922)
This cleans up the JS API
- remove `increment_index`
- removes `createIndex`
- removes `rawSql`

It also bumps the version to 1.5.6 (not yet released) and fixes a type
that changed.
2023-08-04 21:54:31 -07:00
Jeff Huber
dabc2e684c remove raw_sql and pandas (#902)
This is technically a breaking change since we remove the endpoint for
`raw_sql`. `raw_sql` was an undocumented internal tool so we should
discuss how we want to handle this.
2023-07-28 14:11:58 -07:00
Jeff Huber
6cf92f43e7 bump version and release instructions (#835)
- bump to 1.5.5 (already released)
- fix release instructions
2023-07-24 15:27:56 -07:00
Beeno Tung
f645c774ec update usage example to resolve tsc error (#867)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - update js client usage to align with the type definication

## Test plan
*How are these changes tested?*
- put the usage example into a typescript file, test against the current
version of chromadb client package

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*

This update only change the usage example, there maybe some places in
the documentations also need update for similar reason but it is not
directly related to this pull request.
2023-07-24 08:57:50 -07:00
Hammad Bashir
46de47945a SQLite Release PR (#808)
## Description of changes
Base PR to release sqlite refactor, which spans many stacked PRs.

Remaining
- [x] Merge this to main
- [x] Layered Persistent Index #761 
- [x] Remove old impls (In #781 )
- [x] Remove persist() API (In #787)
- [x] Add telemetry to SegmentAPI, it was not included. (#788)
- [x] New clients #805 
- [x] locking and soak tests for thread-safety 
- [x] Migration tool
- [x] Fix #739 
- [x] Fix metadata None vs empty
- [x] Fix persist directory (addressed in #761)
- [x] Leave files open in #761 (merge stacked PR)

Post Release
- [ ] Un xfail cross version tests once we cut the release
- [x] Documentation updates for new silent ADD failure.
- [x] Update all documentation for new API instantiation
- [x] Update all documentation for settings changes
- [ ] Update terraform deployment
- [ ] Update cloudformation deployment

---------

Co-authored-by: Luke VanderHart <luke@vanderhart.net>
Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
Co-authored-by: Anton Troynikov <atroyn@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Sosa <37946988+CakeCrusher@users.noreply.github.com>
Co-authored-by: Russell Pollari <russell@sharpestminds.com>
Co-authored-by: russell-pollari <pollarir@mgail.com>
2023-07-17 14:21:34 -07:00
Sebastian Sosa
ee042ab28b cross compatible fetch with generation pipeline integration (#752)
Related issue #684 
## Description of changes
 - Improvements & Bug fixes
   - npm client is now cross compatible for Node versions <18. 
 - New functionality
- I tested 4 versions: 18.16.0 PASS, 16.18.1 PASS, 14.21.3 PASS, 10.24.1
FAIL

## Test plan
The same tests in
[root/client/js/test](https://github.com/chroma-core/chroma/tree/main/clients/js/test)
must successfully pass under different Node versions for this to work
(they did pass).

## Documentation Changes
Perhaps add here https://docs.trychroma.com/api-reference the supported
version range.

## Notes
The core of this improvement is incredibly simple, it boils down to
adding
```ts
import 'isomorphic-fetch';
```
to
[runtime.ts](https://github.com/chroma-core/chroma/blob/main/clients/js/src/generated/runtime.ts).

Due to the fact that `openapi-generator-plus` is being used I included
some commands to the
[genapi.sh](https://github.com/chroma-core/chroma/blob/main/clients/js/genapi.sh)
to ensure `isomorphic-fetch` will be imported correctly whenever the api
schema is regenerated.

Unfortunately, the openapi-generator has not been run for a while
leading me to believe there is discontinuity between the typescript
package and server openapi typings. As a result running
[genapi.sh](https://github.com/chroma-core/chroma/blob/main/clients/js/genapi.sh)
(running openapi-generator) will lead to clashes in typings. I have
created the following issue #751 reguarding this
2023-07-11 11:09:45 -07:00
Jeff Huber
aae36f57b1 JS Improvements (#649)
This PR has a few fixes
- fix the JS examples to `1.5.1` and add documentation for CORS 
- add a test for `queryTexts` with a stubbed out embedding function
2023-07-08 00:25:48 +00:00
Luke VanderHart
13bf3e070f API implementation for segment-based architecture (#662)
## Description of changes

New API implementation backed by the segment-based architecture. Should
be extensible to a full distributed architecture.

---------

Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
Co-authored-by: hammadb <hammad@trychroma.com>
Co-authored-by: Anton Troynikov <atroyn@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hammad Bashir <HammadB@users.noreply.github.com>
2023-07-05 11:56:39 -07:00
Jeff Huber
11d80a4b63 bump JS to fix cohere embedding function (#742)
bump, already released
2023-07-04 12:52:37 -07:00
Jeff Huber
f92ed424e0 fix port str (#758)
found b/c of this PR against docs
https://github.com/chroma-core/docs/pull/91
2023-07-04 12:34:24 -07:00
Timothy Carambat
e69abfcb21 Enable custom JS Client headers during request to Chroma Instance (#728)
connect #725

## Description of changes
Add a new `fetchOptions` parameter on the JS ChromaClient creation that
allows you to pass in custom `fetch` options.

Example:
```
const chroma = new ChromaClient({
  path: "http://localhost:8000",
  fetchOptions: {
    headers: {
      'X-Api-Token': "sk-live-Hunt3r2", // Works like regular node-fetch headers!
    }
  }
});
```

## Test plan
The existing test suite was run and validated as passing. 

## Documentation Changes
Typescript would allow the developer to know that these options are
available. I do not think it currently requires updates to the Chroma
Documentation - especially since this change is only impacting the JS
client.

---------

Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
2023-06-27 23:43:26 -07:00
Tõnis Tiganik
e6cb2adad9 fix cohere api key (#726)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Fixes cohere embeddings not using the api key.

## Test plan
* I tested that cohere embeddings returned a result
* Without this change the result is undefined

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
no
2023-06-26 13:22:57 -07:00
Suhas Deshpande
dedebb9624 update client usage in example (#724)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - changes the client usage in example
2023-06-23 09:52:59 -07:00
Jeff Huber
889c0bf1d5 fix JS Where type, closes #718 (#722)
fixes #718
2023-06-21 21:32:20 -07:00
Joshua Lochner
974cc7d105 Add embedding support for Transformers.js (#664)
## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
- Add support for
[Transformers.js](https://github.com/xenova/transformers.js). This
allows users to run Hugging Face transformers directly from their JS
applications. For more information, see
https://huggingface.co/docs/transformers.js.

## Test plan
*How are these changes tested?*
I followed the [JS "Getting started"
guide](https://docs.trychroma.com/getting-started?lang=js) to ensure it
works as intended. Here's the script, and its output:
```js
const {ChromaClient, TransformersEmbeddingFunction} = require('chromadb');
const client = new ChromaClient();

// Create the embedder. In this case, I just use the defaults, but you can change the model,
// quantization, revision, or add a progress callback, if desired.
const embedder = new TransformersEmbeddingFunction({ /* Configuration goes here */ });

const main = async () => {
    // Empties and completely resets the database.
    await client.reset()

    // Create the collection
    const collection = await client.createCollection({name: "my_collection", embeddingFunction: embedder})

    // Add some data to the collection
    await collection.add({
        ids: ["id1", "id2", "id3"],
        metadatas: [{"source": "my_source"}, {"source": "my_source"},  {"source": "my_source"}],
        documents: ["I love walking my dog", "This is another document", "This is a legal document"],
    }) 
    
    // Query the collection
    const results = await collection.query({
        nResults: 2, 
        queryTexts: ["This is a query document"]
    }) 
    console.log(results)
    // {
    //     ids: [ [ 'id2', 'id3' ] ],
    //     embeddings: null,
    //     documents: [ [ 'This is another document', 'This is a legal document' ] ],
    //     metadatas: [ [ [Object], [Object] ] ],
    //     distances: [ [ 1.0109775066375732, 1.0756263732910156 ] ]
    // }
}

main();

```


## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
I just added some type annotations for the constructor.
2023-06-21 14:41:58 -07:00
Anton Troynikov
bad9597f6d Fail validation for bools in metadata (#672)
## Description of changes

It turns out `isinstance(bool, int)` returns True. We need to test for
`bool` separately.

Addresses the first part of
https://github.com/chroma-core/chroma/issues/671

## Test plan
A new test, `test_boolean_metadata`, marked xfail.  

## Documentation Changes
None. This now matches the documentation.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-21 14:35:08 -07:00
Jeff Huber
ec54cfb6df js 1.5.2 (#663)
Bump JS to 1.5.2 to pick up the types changes to unblock langchainjs. 

This has already been released to npm.
2023-06-02 14:44:25 -07:00
Russell Pollari
b50ae87f1d Fix incorrect types in QueryResponse (#661)
## Description of changes

 - Improvements & Bug fixes
- Fix incorrect types for `embeddings` and `distances` in
`QueryResponse`
	 - closes: #660 

## Test plan
Tests ran and passed

## Documentation Changes
None

Co-authored-by: russell-pollari <pollarir@mgail.com>
2023-06-02 14:06:01 -07:00
Alexander Visheratin
1c7dba3f89 Web AI embedder for JS library (#633)
## Description of changes

Added a new JavaScript embedding function to generate embeddings for
text and images using the [Web AI](https://github.com/visheratin/web-ai)
library. The users will now be able to generate the embeddings in both
NodeJS and (IMO more importantly) in the browser. This, along with the
existing JS library design, enables the decoupling of embeddings
generation from storage (see example demo below).

## Test plan

I created a demo to check how the function works in web apps -
https://web-ai-chroma.vercel.app/

The embeddings are generated on the client side and sent to the server
to add to the collection or query for similar items.

## Documentation Changes

Likely this change will require changes in the documentation.
2023-05-31 23:26:33 -07:00
Russell Pollari
7405478f4b Catch and throw error in ChromaClient.getCollection (#647)
## Description of changes
When fetching a collection that does not exist, the JS client would fail
silently, returning a collection with `undefined` for all its
attributes.

 - Improvements & Bug fixes
- `ChromaClient.getCollection` will throw an error if there is an error
in the API response
	 - closes: #634 

## Test plan
Passed tests with `$ yarn test`

## Documentation Changes
None

---------

Co-authored-by: russell-pollari <pollarir@mgail.com>
2023-05-31 22:16:07 -07:00
Hammad Bashir
bdc1841e22 Add a thin client (#610)
## Description of changes
*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Typing cleanup
- Changes embedding function defaults to work through the default params
as opposed to via None so that None now means - NO embedding function as
opposed to use the default. This is technically a breaking change.
 - New functionality
- Adds a thin client that restricts what you can create to the REST api
client and builds it separately so it can be published to its own pypi
package. The thin client restricts the default embedding function to be
None always - forcing manual specification of the embedding function
while using the thin client.
- The thin client is built with its own pyproject.toml with a limited
set of dependencies and a is_thin_client.py file that acts as a compile
flag. The build script stages the toml, places the two files in the
right place, performs the build and then tears down the changes.
	 
Addresses #289 

## Test plan
The existing tests should cover this configuration. We can add CI for
the thin-client in the future.

## Documentation Changes
We will add a section on the docs that explains the thin client and its
limitations.
2023-05-31 14:23:10 -07:00
Jeff Huber
bfe9fe7b6a bump JS version and update release process (#643)
Update our release process for JS to avoid missing a fresh build.
2023-05-30 16:55:16 -07:00
Jeff Huber
e406efde2d bump JS to 1.5.0 (#607)
Since our release process is manual - this does not need to land before
release.
2023-05-22 15:42:34 -07:00
Jeff Huber
565f2e4fb8 switch to camelcase inputs (#587)
Switch from `snake_case` to `camelCase` for JS named inputs
2023-05-19 14:11:33 -07:00
ishan
db0af40e17 Chroma core/chrome 536 (#568)
## Description of changes

Please let me know if anything needs to be changed or done differently!
We can certainly continue to make efforts to make our JS client more
structured and maintainable.

*Summary:*
 - Improvements & Bug fixes
	 - Broke `client/js/src/index.ts` down and put them in separate files
- Created `IEmbeddedFunction` interface to improve the maintainability
and extensibility of the client code, making it easier to add new
embedding function types in the future
	 - Replaced `CallableFunction` with `IEmbeddingFunction`
- Closes #536
 - New functionality
	 - None

## Test plan
Refactored tests 
**Note:** the Collection tests have been failing on main when I run
using `yarn test`, did we know about this?

## Documentation Changes
Not sure, couldn't find anything?
2023-05-18 22:03:14 -07:00
Jeff Huber
b5826d1072 switch to named params for JS client (#513)
In this PR
- docstrings! 
- types!
- named params! 

This is a breaking change to the JS Client - it switches from positional
to named arguments originally brought up by @transitive-bullshit in
https://github.com/chroma-core/chroma/issues/254

Example: 

```
// before
const collection = await chroma.createCollection("test");

//after
const collection = await chroma.createCollection({ name: "test" });
```

This is especially nice when you are only using a few params. 

This PR does not bump the `npm` version number - we will cut a new
release on Monday.

We will need to land an update to our docs at that time as well. TBD
2023-05-17 09:39:20 -07:00
Jeff Huber
6ec5d7a169 bump to 1.4.2. (#552)
Bump npm to 1.4.2 for release today
2023-05-16 09:26:42 -07:00
Jeff Huber
d493ef6ea0 Merge branch 'main' into patch-5 2023-05-11 15:10:31 -07:00
Hammad Bashir
c17249b818 Add precommit hooks (#483)
Adds precommit hooks based on #433 to our repository. Only one file here is new - the configuration for the hooks, everything else is linting/formatting fixes. We do not run the typechecker globally since that would be quite lengthy to clean up - instead we will have to incrementally clean up type check issues as we go.
2023-05-10 05:52:12 +00:00