-
-
Notifications
You must be signed in to change notification settings - Fork 23.6k
Chore/deprecating llamaindex #5654
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
Conversation
Summary of ChangesHello @HenryHengZJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a deprecation strategy for all LlamaIndex integrations within the system. The primary goal is to clearly communicate to users and developers that these components are no longer actively supported and will be removed in a future release. This is achieved by programmatically marking the components as deprecated and providing a visual cue in the UI, ensuring a smooth transition away from LlamaIndex dependencies. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds deprecation notices to all LlamaIndex-related nodes, which is a good step. My review focuses on improving code quality and maintainability. I've pointed out several instances of duplicated code, specifically the deprecation message which is repeated across 22 files. Extracting this into a shared constant would be a significant improvement. Additionally, in the UI code, I've suggested refactoring inline styles and magic strings to use theme variables and constants for better consistency and readability. The provided rule regarding generic images for error pages does not apply to any of the comments in this review.
| this.baseClasses = [this.type, ...getBaseClasses(AnthropicAgent)] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, ...getBaseClasses(OpenAIAgent)] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, 'BaseChatModel_LlamaIndex', ...getBaseClasses(OpenAI)] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, 'BaseChatModel_LlamaIndex', ...getBaseClasses(Anthropic)] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, 'BaseChatModel_LlamaIndex', ...getBaseClasses(MistralAI)] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.description = 'Tool used to invoke query engine' | ||
| this.baseClasses = [this.type, 'Tool_LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, 'VectorIndexRetriever'] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.baseClasses = [this.type, 'VectorIndexRetriever'] | ||
| this.tags = ['LlamaIndex'] | ||
| this.badge = 'DEPRECATING' | ||
| this.deprecateMessage = 'LlamaIndex integration is deprecated and will be removed in a future release.' |
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.
| src={getImage(index)} | ||
| alt={item} | ||
| /> | ||
| {item === 'LlamaIndex' && ( |
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.
The string 'LlamaIndex' is used here and in the tabs definition. To avoid magic strings and improve maintainability, consider defining the tab names as constants. For example: const TABS = { LANGCHAIN: 'LangChain', LLAMAINDEX: 'LlamaIndex', UTILITIES: 'Utilities' }; and then use item === TABS.LLAMAINDEX.
| style={{ | ||
| position: 'absolute', | ||
| top: '-4px', | ||
| right: '-6px', | ||
| backgroundColor: '#ff9800', | ||
| color: 'white', | ||
| borderRadius: '50%', | ||
| width: '12px', | ||
| height: '12px', | ||
| fontSize: '10px', | ||
| fontWeight: 'bold', | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'center' | ||
| }} |
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.
These inline styles should be moved to the sx prop to leverage Material-UI's styling solution and use theme variables. This improves maintainability and consistency with the rest of the codebase. For example, backgroundColor: '#ff9800' can be replaced with backgroundColor: 'warning.main'.
| style={{ | |
| position: 'absolute', | |
| top: '-4px', | |
| right: '-6px', | |
| backgroundColor: '#ff9800', | |
| color: 'white', | |
| borderRadius: '50%', | |
| width: '12px', | |
| height: '12px', | |
| fontSize: '10px', | |
| fontWeight: 'bold', | |
| display: 'flex', | |
| alignItems: 'center', | |
| justifyContent: 'center' | |
| }} | |
| sx={{ | |
| position: 'absolute', | |
| top: '-4px', | |
| right: '-6px', | |
| backgroundColor: 'warning.main', | |
| color: 'white', | |
| borderRadius: '50%', | |
| width: '12px', | |
| height: '12px', | |
| fontSize: '10px', | |
| fontWeight: 'bold', | |
| display: 'flex', | |
| alignItems: 'center', | |
| justifyContent: 'center' | |
| }} |
No description provided.