-
Notifications
You must be signed in to change notification settings - Fork 6k
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
fix: adds priority sorting for sidebar components and makes LanguageModel appear first #7322
Conversation
CodSpeed Performance ReportMerging #7322 will improve performances by 56.67%Comparing Summary
Benchmarks breakdown
|
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 don't think this should be in the backend as it would be a per component attribute (because we are adding the same attribute to all language models).
Also, this should have been added to the Component
class.
I think if we are just changing things in the UI it must not depend on what the code tells us because if we change it later, users' components will still have the old value.
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.
lgtm
@@ -19,6 +19,7 @@ class LanguageModelComponent(LCModelComponent): | |||
icon = "brain-circuit" | |||
name = "LanguageModel" |
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.
name = "LanguageModel" |
…odel appear first (#7322) * Added priority field to components * Added priority as 0 to LanguageModelComponent * Adds sorting based on priority * refactor: remove redundant name attribute from LanguageModelComponent * Updated custom component to include priority --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* commit '6c2ff92ccf083f038d9a97a749b4e0f30a60247a': (255 commits) docs: Update documentation and add TAVILY_API_KEY to environment variables (langflow-ai#7366) docs: mcp server component and integrations (langflow-ai#7286) docs: v1.3 (langflow-ai#7160) chore(deps-dev): bump vite from 5.4.14 to 5.4.16 in /src/frontend (langflow-ai#7365) fix: add secret key loading functionality to basic templates (langflow-ai#7363) docs: platform content (langflow-ai#7091) chore: bump langflow and langflow-base for 1.3.0 release (langflow-ai#7362) docs: ensure asset paths update on draft rebuilds (langflow-ai#7355) fix: Prevent API key banner from displaying when key is unavailable (langflow-ai#7356) fix: MCP SSE Model tool mode issue (langflow-ai#7360) feat: deprecate Parsing component and replace them in starter projects (langflow-ai#6697) fix: fixed the parser component (langflow-ai#7303) ref: split ast parsing / class exec loops (langflow-ai#7248) feat: Update AgentQL templates (langflow-ai#7165) feat: add a unified local vector store (langflow-ai#6995) fix: update currentflow to be fetched from Flow Store for icon to be rendered correctly (langflow-ai#7354) feat: expose serialization truncation constants in /config route (langflow-ai#7316) feat: lmprove MCP langflow port selection and error handling (langflow-ai#7327) fix: adds priority sorting for sidebar components and makes LanguageModel appear first (langflow-ai#7322) fix: make agent work with new tool mode backend updates (langflow-ai#7314) ... # Conflicts: # src/frontend/src/utils/styleUtils.ts 更新到V1.3.0
This pull request introduces a new priority attribute to various models and updates the sorting logic to utilize this attribute. The most important changes include adding the priority attribute to the
LanguageModelComponent
class, updating the attribute handling functions, and modifying the frontend to sort items based on priority.Changes to models:
src/backend/base/langflow/components/models/language_model.py
: Added apriority
attribute to theLanguageModelComponent
class to set the display order.src/backend/base/langflow/template/frontend_node/base.py
: Added apriority
attribute to theFrontendNode
class to define the display order.Attribute handling updates:
src/backend/base/langflow/custom/attributes.py
: Added a new functiongetattr_return_int
to handle integer attributes and updated the attribute dictionary to include thepriority
attribute. [1] [2]Frontend updates:
src/frontend/src/pages/FlowPage/components/flowSidebarComponent/components/sidebarItemsList/index.tsx
: Modified the sorting logic to prioritize items based on thepriority
attribute if available.