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

weaviate[minor]: Add Document className as metadata #7486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libs/langchain-weaviate/src/vectorstores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ export class WeaviateStore extends VectorStore {
documents.push([
new Document({
pageContent: text,
metadata: rest,
metadata: {
...rest,
className: this.indexName
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just call it indexName instead of className?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but the idea is to export the className metadata field from weaviate. Since we are exporting this field in the Document interface metadata field, I would think is even safer to use className to avoid any field name collision.

PD: Thanks for the fast feedback!

},
id: _additional.id,
}),
_additional.distance,
Expand Down