-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
refact: Refactor Document
to be natively multimodal
#17204
Conversation
@@ -300,6 +301,7 @@ class BaseNode(BaseComponent): | |||
metadata_separator: str = Field( | |||
default="\n", | |||
description="Separator between metadata fields when converting to string.", | |||
alias="metadata_seperator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
@@ -537,18 +539,25 @@ def hash(self) -> str: | |||
|
|||
|
|||
class Node(BaseNode): | |||
text: MediaResource | None = Field( | |||
text_resource: MediaResource | None = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this have an impact on the current openai multimodal stuff we had working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it won't, even if the logic is almost duplicated (and we might want to refactor it later), that depends on ChatMessage
and not Node
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mostly fine, but I need to take the PR for a run, want to make sure serialized data from the old stuff still works in the new stuff
ec10315
to
bc4ac96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested a few indexes created in main and loading them with this PR (an in memory vector index, qdrant, as well as adding both nodes and documents into the docstore)
All tests worked (i.e. forward compatible), so I think this is safe? 🙏🏻
Description
Document
derive fromNode
and inherit its multimodal capabilities.Part of #15950
Version Bump?
Did I bump the version in the
pyproject.toml
file of the package I am updating? (Except for thellama-index-core
package)Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.