mckaywrigley/ai-brainstore

Errors running npm run agent with Chroma

baasitbhutta opened this issue · 0 comments

After following the tutorial and getting to the 'npm run agent' line, I am getting the following error:
chroma/clients/js/examples/browser/app.ts:5:35 - error TS2559: Type '"http://localhost:8000"' has no properties in common with type '{ path?: string; }'.

5 const chroma = new ChromaClient("http://localhost:8000");
~~~~~~~~~~~~~~~~~~~~~~~

chroma/clients/js/examples/browser/app.ts:8:52 - error TS2345: Argument of type
'string' is not assignable to parameter of type '{ name: string; metadata?: CollectionMetadata; embeddingFunction?: IEmbeddingFunction; }'.

8 const collection = await chroma.createCollection("test-from-js");
~~~~~~~~~~~~~~

chroma/clients/js/examples/browser/app.ts:21:39 - error TS2554: Expected 1 arguments, but got 3.

21 let add = await collection.add(ids, embeddings, metadata);
~~~~~~~~~~~~~~~~~~~~

chroma/clients/js/examples/browser/app.ts:27:61 - error TS2554: Expected 1 arguments, but got 3.

27 const queryData = await collection.query([1, 2, 3, 4, 5], 5, {
~~~~
28 test: "test",

29   });
~~~

chroma/clients/js/jest.config.ts:1:29 - error TS2307: Cannot find module '@jest/types' or its corresponding type declarations.

1 import type { Config } from "@jest/types";
                           ~~~~~~~~~~~~~

chroma/clients/js/test/add.collections.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from '@jest/globals';
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/client.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/collection.client.test.ts:1:42 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test, beforeEach } from "@jest/globals";
                                        ~~~~~~~~~~~~~~~

chroma/clients/js/test/collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/delete.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/get.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/peek.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/query.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/update.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from "@jest/globals";
                            ~~~~~~~~~~~~~~~

chroma/clients/js/test/upsert.collections.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.

1 import { expect, test } from '@jest/globals';
                            ~~~~~~~~~~~~~~~

index.ts:12:48 - error TS2345: Argument of type 'string' is not assignable to pa
rameter of type '{ openai_api_key: string; openai_model?: string; openai_organization_id?: string; }'.

12   const embedder = new OpenAIEmbeddingFunction(process.env.OPENAI_API_KEY);  
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~    

node_modules/langchain/dist/vectorstores/hnswlib.d.ts:1:69 - error TS2307: Cannot find module 'hnswlib-node' or its corresponding type declarations.

1 import type { HierarchicalNSW as HierarchicalNSWT, SpaceName } from "hnswlib-node";
                                                                   ~~~~~~~~~~~~~~

utils/index.ts:23:55 - error TS2554: Expected 1 arguments, but got 2.

23     return await client.getCollection(collectionName, embedder);
                                                      ~~~~~~~~

utils/index.ts:26:70 - error TS2554: Expected 1 arguments, but got 3.

26     const collection = await client.createCollection(collectionName, {}, embedder);
                                                                     ~~~~~~~~~~~~

utils/index.ts:86:43 - error TS2554: Expected 1 arguments, but got 4.

  1  chroma/clients/js/test/get.collection.test.ts:1
  1  chroma/clients/js/test/peek.collection.test.ts:1
  1  chroma/clients/js/test/query.collection.test.ts:1
  1  chroma/clients/js/test/update.collection.test.ts:1
  1  chroma/clients/js/test/upsert.collections.test.ts:1
  1  index.ts:12
  1  node_modules/langchain/dist/vectorstores/hnswlib.d.ts:1
  3  utils/index.ts:23