Skip to content

Conversation

@philippgille
Copy link
Owner

@philippgille philippgille commented Mar 4, 2024

Namely AddDocument() and AddDocuments(), taking the newly exported Document struct as parameter.

This PR also includes some changes of prior "document" mentions to "content" or "text" to avoid misunderstandings.
As well as a refactoring of the error handling in the parallelization code due to two errors requiring handling when documents are added concurrently (and while doing that it made sense to adapt the error handling in the Query method in the same way).

The example code is also changed to use the new methods.

Taking Document objects instead of individual
ids/metadata/embeddings/content parameters.

Move doc metadata copying from constructor to addition to collection,
as we don't use the map before it's added to the collection
To match the refactoring in Collection.AddDocuments
from the previous commit
To differentiate between our now exported Document struct
and its contents.
@philippgille philippgille merged commit ed5dca6 into main Mar 4, 2024
@philippgille philippgille deleted the add-go-idiomatic-methods branch March 4, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants