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

[bug] the Metadata taken from Chroma is inconsistent? #9

Open
theoneLee opened this issue Oct 7, 2023 · 2 comments
Open

[bug] the Metadata taken from Chroma is inconsistent? #9

theoneLee opened this issue Oct 7, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@theoneLee
Copy link

I run Demo, but I find the Metadata taken from Chroma is inconsistent. Is it a bug?

this is a log:
image

col, _ := client.CreateCollection(collectionName, metadata, true, embeddingFunction, distanceFunction)
	documents := []string{
		"This is a document about cats. Cats are great.",
		"this is a document about dogs. Dogs are great.",
	}
	ids := []string{
		"ID1",
		"ID2",
	}

	metadatas := []map[string]any{
		{"key1": "value1"},
		{"key2": "value2"},
	}
	_, addError := col.Add(nil, metadatas, documents, ids)
	if addError != nil {
		fmt.Printf("Error adding documents: %s", addError)
		return
	}
	countDocs, qrerr := col.Count()
	if qrerr != nil {
		fmt.Printf("Error counting documents: %s", qrerr)
		return
	}
	fmt.Printf("countDocs: %v\n", countDocs) //this should result in 2
	qr, qrerr := col.Query([]string{"I love dogs"}, 5, nil, nil, nil)
	if qrerr != nil {
		fmt.Printf("Error querying documents: %s", qrerr)
		return
	}
	fmt.Printf("qr: %v\n", toJson(qr))
	fmt.Printf("qr.Documents[0][0]: %v\n", qr.Documents[0][0]) //this should result in the document about dogs
@tazarov tazarov self-assigned this Oct 9, 2023
@tazarov
Copy link
Contributor

tazarov commented Oct 9, 2023

@theoneLee, this looks weird. Let me have a look.

@tazarov tazarov added the bug Something isn't working label Mar 7, 2024
@tazarov
Copy link
Contributor

tazarov commented Mar 13, 2024

@theoneLee this should be fixed in v0.1.0

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

When branches are created from issues, their pull requests are automatically linked.

2 participants