Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add document to Chroma using Llamaindex #1093

Open
aadityarajkumawat opened this issue Jul 30, 2024 · 0 comments
Open

Unable to add document to Chroma using Llamaindex #1093

aadityarajkumawat opened this issue Jul 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@aadityarajkumawat
Copy link

chromadb: v1.8.1
llamaindex: v0.5.11

  const chromaVS = new ChromaVectorStore({
    collectionName: `user-user_2jqvVWTCmv3WL1WAgL1JfCjbqbl`,
    chromaClientParams: {
      path: CHROMA_URL,
    },
    embedModel: openAIEmbeddingFunction,
  });

  const userCollection = await chromaVS.getCollection();

  const docs = await userCollection.get();

  // const userCollection = await chroma.getCollection({
  //   name: "user-user_2jqvVWTCmv3WL1WAgL1JfCjbqbl",
  //   embeddingFunction: openAIEmbeddingFunction,
  // });

  await userCollection.delete();

  // console.log({
  //   ...docs,
  //   documents: docs.documents.map((d) => d.substring(0, 100)),
  // });

  try {
    const r = await userCollection.add({
      ids: ["1", "2", "3"],
      documents: ["hello", "world", "how"],
    });

    console.log(r.error);

    let dics = await userCollection.get();

    console.log(dics);
  } catch (error) {
    console.log(error);
  }

When trying to add documents, it logs out the following error:

Response {
  [Symbol(realm)]: null,
  [Symbol(state)]: {
    aborted: false,
    rangeRequested: false,
    timingAllowPassed: true,
    requestIncludesCredentials: true,
    type: 'default',
    status: 500,
    timingInfo: {
      startTime: 3489.4367500543594,
      redirectStartTime: 0,
      redirectEndTime: 0,
      postRedirectStartTime: 3489.4367500543594,
      finalServiceWorkerStartTime: 0,
      finalNetworkResponseStartTime: 0,
      finalNetworkRequestStartTime: 0,
      endTime: 3680.7292079925537,
      encodedBodySize: 0,
      decodedBodySize: 0,
      finalConnectionTimingInfo: null
    },
    cacheState: '',
    statusText: 'Internal Server Error',
    headersList: HeadersList {
      cookies: null,
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    },
    urlList: [ [URL] ],
    body: { stream: undefined }
  },
  [Symbol(headers)]: HeadersList {
    cookies: null,
    [Symbol(headers map)]: Map(6) {
      'content-encoding' => [Object],
      'content-type' => [Object],
      'date' => [Object],
      'server' => [Object],
      'x-request-id' => [Object],
      'content-length' => [Object]
    },
    [Symbol(headers map sorted)]: null
  }
}

The error itself isn't very useful, so I am not sure what goes wrong?

@himself65 himself65 added the bug Something isn't working label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants