Skip to content

Conversation

@edwinjosechittilappilly
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly commented Jul 2, 2025

This pull request includes updates to the langflow component structure to improve modularity and maintainability by introducing explicit imports and __all__ declarations in various component __init__.py files. Additionally, it includes a file renaming and a minor update to a component's metadata.

Component Initialization Updates:

  • Added explicit imports and __all__ declarations in the __init__.py files for the following components: arxiv, baidu, bing, cloudflare, cohere, deepseek, duckduckgo, exa, and glean. This ensures better encapsulation and clarity for each module. [1] [2] [3] [4] [5] [6] [7] [8] [9]

File Organization and Metadata Update:

  • Renamed src/backend/base/langflow/components/languagemodels/cohere.py to src/backend/base/langflow/components/cohere/cohere_models.py to better align with the modular structure. Updated the display_name of the CohereComponent class to "Cohere Language Models" for improved clarity.

Embeddings Component Adjustments:

  • Updated imports in src/backend/base/langflow/components/embeddings/__init__.py to reflect the new modular structure, removing unused imports for CohereEmbeddingsComponent and LMStudioEmbeddingsComponent. This simplifies the embeddings module.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces or refines __init__.py files across multiple backend component directories, establishing explicit public APIs by controlling which classes are exported. Several components are now directly exposed via their respective package initializers. Some modules, such as languagemodels and memories, had their __init__.py files removed. The frontend's sidebar bundles list was extensively reorganized, adding, removing, and reordering entries.

Changes

File(s) Change Summary
.../components/baidu/init.py
.../components/cloudflare/init.py
.../components/deepseek/init.py
.../components/groq/init.py
.../components/lmstudio/init.py
.../components/maritalk/init.py
.../components/mem0/init.py
.../components/mistral/init.py
.../components/novita/init.py
.../components/openrouter/init.py
.../components/perplexity/init.py
.../components/redis/init.py
.../components/sambanova/init.py
.../components/xai/init.py
.../components/zep/init.py
Added new __init__.py files to expose specific components via __all__ and import statements.
.../components/cohere/init.py Expanded exports: now includes CohereComponent and CohereEmbeddingsComponent in addition to CohereRerankComponent.
.../components/cohere/cohere_models.py Updated CohereComponent.display_name from "Cohere" to "Cohere Language Models".
.../components/embeddings/init.py Changed import paths for Cloudflare and Mistral embeddings; removed Cohere and LMStudio embeddings from exports.
.../components/languagemodels/init.py
.../components/memories/init.py
Deleted files; removed central exports for language models and memory components.
src/frontend/src/utils/styleUtils.ts Extensively reordered, added, and removed entries in the SIDEBAR_BUNDLES array.

Sequence Diagram(s)

sequenceDiagram
    participant Importer
    participant PackageInit
    participant Component

    Importer->>PackageInit: import from package (e.g., from baidu import QianfanChatEndpoint)
    PackageInit->>Component: import Component (e.g., QianfanChatEndpoint)
    PackageInit-->>Importer: expose only components listed in __all__
Loading

Suggested labels

enhancement, size:L, lgtm

Suggested reviewers

  • edwinjosechittilappilly
  • mendonk
  • ogabrielluiz
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in a Comment
  • Commit Unit Tests in branch ref/sidebar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 2, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (7)
src/backend/base/langflow/components/zep/__init__.py (1)

1-3: Consider lazy import to avoid heavy optional dependency

Importing ZepChatMemory immediately pulls zep_python, httpx, etc. Any user merely doing import langflow will now need those extras installed even if they never use Zep.

-from .zep import ZepChatMemory
-
-__all__ = ["ZepChatMemory"]
+# Lazy import defers the heavy dependency until the class is first accessed
+import importlib
+
+def _lazy():
+    return getattr(importlib.import_module(__name__ + ".zep"), "ZepChatMemory")
+
+class _Proxy:
+    def __getattr__(self, item):
+        return getattr(_lazy(), item)
+
+ZepChatMemory = _Proxy()  # type: ignore
+__all__ = ["ZepChatMemory"]

This keeps current semantics (from ..zep import ZepChatMemory still works) but spares downstream projects from unwanted dependencies.

src/backend/base/langflow/components/redis/__init__.py (1)

1-3: Name collision risk & eager dependency load

  1. redis is also the top-level PyPI package name. Having a sibling file redis.py creates two different module names (langflow.components.redis vs redis). Inside that file any unqualified import redis statement will import itself, not the external driver. Please double-check the implementation.

  2. Similar to the Zep comment, importing RedisIndexChatMemory upfront forces the redis driver and langchain extras to be present. A lazy import pattern can avoid this.

src/backend/base/langflow/components/baidu/__init__.py (1)

1-3: Optional: defer heavy Baidu SDK import

QianfanChatEndpoint likely drags huge Baidu SDKs; exporting via a small lazy wrapper (see Zep example) will make the base package lighter for users who do not need Baidu.

src/backend/base/langflow/components/openrouter/__init__.py (1)

1-3: Optional: adopt lazy import for OpenRouter

Same reasoning: the OpenRouter component depends on httpx, openai, etc. Consider a deferred import to keep the base install lean.

src/backend/base/langflow/components/groq/__init__.py (1)

1-3: Nit: keep __all__ entries alphabetised when >1 appear

Right now there’s only one symbol, so no issue. Just a reminder for future additions.

src/backend/base/langflow/components/mistral/__init__.py (1)

1-2: Reorder imports alphabetically by component name.

According to the coding guidelines, imports should be in alphabetical order when adding new components. The imports should be ordered by the component name being imported.

Apply this diff to fix the import order:

-from .mistral import MistralAIModelComponent
-from .mistral_embeddings import MistralAIEmbeddingsComponent
+from .mistral_embeddings import MistralAIEmbeddingsComponent
+from .mistral import MistralAIModelComponent
src/backend/base/langflow/components/cohere/__init__.py (1)

1-3: Reorder imports alphabetically by component name.

The imports should be ordered alphabetically by the component name being imported, consistent with the coding guidelines.

Apply this diff to fix the import order:

-from .cohere_embeddings import CohereEmbeddingsComponent
-from .cohere_models import CohereComponent
+from .cohere_models import CohereComponent
+from .cohere_embeddings import CohereEmbeddingsComponent
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf60ec and 0d518c5.

📒 Files selected for processing (21)
  • src/backend/base/langflow/components/baidu/__init__.py (1 hunks)
  • src/backend/base/langflow/components/cloudflare/__init__.py (1 hunks)
  • src/backend/base/langflow/components/cohere/__init__.py (1 hunks)
  • src/backend/base/langflow/components/cohere/cohere_models.py (1 hunks)
  • src/backend/base/langflow/components/deepseek/__init__.py (1 hunks)
  • src/backend/base/langflow/components/embeddings/__init__.py (1 hunks)
  • src/backend/base/langflow/components/groq/__init__.py (1 hunks)
  • src/backend/base/langflow/components/languagemodels/__init__.py (0 hunks)
  • src/backend/base/langflow/components/lmstudio/__init__.py (1 hunks)
  • src/backend/base/langflow/components/maritalk/__init__.py (1 hunks)
  • src/backend/base/langflow/components/mem0/__init__.py (1 hunks)
  • src/backend/base/langflow/components/memories/__init__.py (0 hunks)
  • src/backend/base/langflow/components/mistral/__init__.py (1 hunks)
  • src/backend/base/langflow/components/novita/__init__.py (1 hunks)
  • src/backend/base/langflow/components/openrouter/__init__.py (1 hunks)
  • src/backend/base/langflow/components/perplexity/__init__.py (1 hunks)
  • src/backend/base/langflow/components/redis/__init__.py (1 hunks)
  • src/backend/base/langflow/components/sambanova/__init__.py (1 hunks)
  • src/backend/base/langflow/components/xai/__init__.py (1 hunks)
  • src/backend/base/langflow/components/zep/__init__.py (1 hunks)
  • src/frontend/src/utils/styleUtils.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • src/backend/base/langflow/components/memories/init.py
  • src/backend/base/langflow/components/languagemodels/init.py
🧰 Additional context used
📓 Path-based instructions (6)
`src/backend/base/langflow/components/**/*.py`: Add new backend components to th...

src/backend/base/langflow/components/**/*.py: Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Implement async component methods using async def and await for asynchronous operations
Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation
Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

📄 Source: CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

List of files the instruction was applied to:

  • src/backend/base/langflow/components/lmstudio/__init__.py
  • src/backend/base/langflow/components/groq/__init__.py
  • src/backend/base/langflow/components/cloudflare/__init__.py
  • src/backend/base/langflow/components/perplexity/__init__.py
  • src/backend/base/langflow/components/zep/__init__.py
  • src/backend/base/langflow/components/openrouter/__init__.py
  • src/backend/base/langflow/components/deepseek/__init__.py
  • src/backend/base/langflow/components/novita/__init__.py
  • src/backend/base/langflow/components/mem0/__init__.py
  • src/backend/base/langflow/components/baidu/__init__.py
  • src/backend/base/langflow/components/mistral/__init__.py
  • src/backend/base/langflow/components/cohere/__init__.py
  • src/backend/base/langflow/components/embeddings/__init__.py
  • src/backend/base/langflow/components/xai/__init__.py
  • src/backend/base/langflow/components/cohere/cohere_models.py
  • src/backend/base/langflow/components/maritalk/__init__.py
  • src/backend/base/langflow/components/redis/__init__.py
  • src/backend/base/langflow/components/sambanova/__init__.py
`src/backend/base/langflow/components/**/__init__.py`: Update __init__.py with alphabetical imports when adding new components

src/backend/base/langflow/components/**/__init__.py: Update init.py with alphabetical imports when adding new components

📄 Source: CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

List of files the instruction was applied to:

  • src/backend/base/langflow/components/lmstudio/__init__.py
  • src/backend/base/langflow/components/groq/__init__.py
  • src/backend/base/langflow/components/cloudflare/__init__.py
  • src/backend/base/langflow/components/perplexity/__init__.py
  • src/backend/base/langflow/components/zep/__init__.py
  • src/backend/base/langflow/components/openrouter/__init__.py
  • src/backend/base/langflow/components/deepseek/__init__.py
  • src/backend/base/langflow/components/novita/__init__.py
  • src/backend/base/langflow/components/mem0/__init__.py
  • src/backend/base/langflow/components/baidu/__init__.py
  • src/backend/base/langflow/components/mistral/__init__.py
  • src/backend/base/langflow/components/cohere/__init__.py
  • src/backend/base/langflow/components/embeddings/__init__.py
  • src/backend/base/langflow/components/xai/__init__.py
  • src/backend/base/langflow/components/maritalk/__init__.py
  • src/backend/base/langflow/components/redis/__init__.py
  • src/backend/base/langflow/components/sambanova/__init__.py
`src/backend/**/*.py`: Run make format_backend to format Python code early and often Run make lint to check for linting issues in backend Python code

src/backend/**/*.py: Run make format_backend to format Python code early and often
Run make lint to check for linting issues in backend Python code

📄 Source: CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

List of files the instruction was applied to:

  • src/backend/base/langflow/components/lmstudio/__init__.py
  • src/backend/base/langflow/components/groq/__init__.py
  • src/backend/base/langflow/components/cloudflare/__init__.py
  • src/backend/base/langflow/components/perplexity/__init__.py
  • src/backend/base/langflow/components/zep/__init__.py
  • src/backend/base/langflow/components/openrouter/__init__.py
  • src/backend/base/langflow/components/deepseek/__init__.py
  • src/backend/base/langflow/components/novita/__init__.py
  • src/backend/base/langflow/components/mem0/__init__.py
  • src/backend/base/langflow/components/baidu/__init__.py
  • src/backend/base/langflow/components/mistral/__init__.py
  • src/backend/base/langflow/components/cohere/__init__.py
  • src/backend/base/langflow/components/embeddings/__init__.py
  • src/backend/base/langflow/components/xai/__init__.py
  • src/backend/base/langflow/components/cohere/cohere_models.py
  • src/backend/base/langflow/components/maritalk/__init__.py
  • src/backend/base/langflow/components/redis/__init__.py
  • src/backend/base/langflow/components/sambanova/__init__.py
`src/backend/**/components/**/*.py`: In your Python component class, set the `icon` attribute to a string matching the frontend icon mapping exactly (case-sensitive).

src/backend/**/components/**/*.py: In your Python component class, set the icon attribute to a string matching the frontend icon mapping exactly (case-sensitive).

📄 Source: CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

List of files the instruction was applied to:

  • src/backend/base/langflow/components/lmstudio/__init__.py
  • src/backend/base/langflow/components/groq/__init__.py
  • src/backend/base/langflow/components/cloudflare/__init__.py
  • src/backend/base/langflow/components/perplexity/__init__.py
  • src/backend/base/langflow/components/zep/__init__.py
  • src/backend/base/langflow/components/openrouter/__init__.py
  • src/backend/base/langflow/components/deepseek/__init__.py
  • src/backend/base/langflow/components/novita/__init__.py
  • src/backend/base/langflow/components/mem0/__init__.py
  • src/backend/base/langflow/components/baidu/__init__.py
  • src/backend/base/langflow/components/mistral/__init__.py
  • src/backend/base/langflow/components/cohere/__init__.py
  • src/backend/base/langflow/components/embeddings/__init__.py
  • src/backend/base/langflow/components/xai/__init__.py
  • src/backend/base/langflow/components/cohere/cohere_models.py
  • src/backend/base/langflow/components/maritalk/__init__.py
  • src/backend/base/langflow/components/redis/__init__.py
  • src/backend/base/langflow/components/sambanova/__init__.py
`src/frontend/**/*.{ts,tsx}`: Use React 18 with TypeScript for all UI components and frontend logic.

src/frontend/**/*.{ts,tsx}: Use React 18 with TypeScript for all UI components and frontend logic.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/utils/styleUtils.ts
`src/frontend/**/*.{ts,tsx,js,jsx,css,scss}`: Use Tailwind CSS for styling all frontend components.

src/frontend/**/*.{ts,tsx,js,jsx,css,scss}: Use Tailwind CSS for styling all frontend components.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/utils/styleUtils.ts
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/lmstudio/__init__.py (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/groq/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/cloudflare/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
src/backend/base/langflow/components/perplexity/__init__.py (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/zep/__init__.py (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/openrouter/__init__.py (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/deepseek/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/novita/__init__.py (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/mem0/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
src/backend/base/langflow/components/baidu/__init__.py (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/mistral/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
src/backend/base/langflow/components/cohere/__init__.py (5)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Test backward compatibility across Langflow versions by mapping component files to supported versions using 'VersionComponentMapping'.
src/backend/base/langflow/components/embeddings/__init__.py (6)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Test backward compatibility across Langflow versions by mapping component files to supported versions using 'VersionComponentMapping'.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/xai/__init__.py (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
src/backend/base/langflow/components/cohere/cohere_models.py (8)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.667Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize 'Langflow', 'Component', and 'Flow' when referring to Langflow concepts; always uppercase 'API' and 'JSON'.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Test backward compatibility across Langflow versions by mapping component files to supported versions using 'VersionComponentMapping'.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Use 'MockLanguageModel' for testing language model components without external API calls.
src/backend/base/langflow/components/maritalk/__init__.py (5)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/ and its subdirectories
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Use 'MockLanguageModel' for testing language model components without external API calls.
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
src/backend/base/langflow/components/redis/__init__.py (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/components/sambanova/__init__.py (3)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
src/frontend/src/utils/styleUtils.ts (4)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-30T14:40:02.667Z
Learning: Applies to docs/sidebars.js : Sidebar navigation must be configured and updated in 'docs/sidebars.js' to reflect the current documentation structure.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-30T14:40:50.836Z
Learning: Use clear, recognizable, and consistent icon names for both backend and frontend (e.g., 'AstraDB', 'Postgres', 'OpenAI').
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-30T14:40:50.836Z
Learning: Applies to src/frontend/src/icons/lazyIconImports.ts : Add your icon to the `lazyIconsMapping` object in `src/frontend/src/icons/lazyIconImports.ts` with a key that matches the backend icon string exactly.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).
🧬 Code Graph Analysis (11)
src/backend/base/langflow/components/lmstudio/__init__.py (2)
src/backend/base/langflow/components/lmstudio/lmstudioembeddings.py (1)
  • LMStudioEmbeddingsComponent (13-91)
src/backend/base/langflow/components/lmstudio/lmstudiomodel.py (1)
  • LMStudioModelComponent (14-129)
src/backend/base/langflow/components/cloudflare/__init__.py (1)
src/backend/base/langflow/components/cloudflare/cloudflare.py (1)
  • CloudflareWorkersAIEmbeddingsComponent (8-81)
src/backend/base/langflow/components/zep/__init__.py (1)
src/backend/base/langflow/components/zep/zep.py (1)
  • ZepChatMemory (6-44)
src/backend/base/langflow/components/openrouter/__init__.py (1)
src/backend/base/langflow/components/openrouter/openrouter.py (1)
  • OpenRouterComponent (20-202)
src/backend/base/langflow/components/deepseek/__init__.py (1)
src/backend/base/langflow/components/deepseek/deepseek.py (1)
  • DeepSeekModelComponent (13-136)
src/backend/base/langflow/components/novita/__init__.py (1)
src/backend/base/langflow/components/novita/novita.py (1)
  • NovitaModelComponent (21-130)
src/backend/base/langflow/components/mem0/__init__.py (1)
src/backend/base/langflow/components/mem0/mem0_chat_memory.py (1)
  • Mem0MemoryComponent (18-142)
src/backend/base/langflow/components/mistral/__init__.py (2)
src/backend/base/langflow/components/mistral/mistral.py (1)
  • MistralAIModelComponent (9-114)
src/backend/base/langflow/components/mistral/mistral_embeddings.py (1)
  • MistralAIEmbeddingsComponent (9-58)
src/backend/base/langflow/components/embeddings/__init__.py (2)
src/backend/base/langflow/components/cloudflare/cloudflare.py (1)
  • CloudflareWorkersAIEmbeddingsComponent (8-81)
src/backend/base/langflow/components/mistral/mistral_embeddings.py (1)
  • MistralAIEmbeddingsComponent (9-58)
src/backend/base/langflow/components/xai/__init__.py (1)
src/backend/base/langflow/components/xai/xai.py (1)
  • XAIModelComponent (22-167)
src/backend/base/langflow/components/redis/__init__.py (1)
src/backend/base/langflow/components/redis/redis.py (1)
  • RedisIndexChatMemory (10-43)
🪛 Pylint (3.3.7)
src/backend/base/langflow/components/perplexity/__init__.py

[error] 1-1: No name 'PerplexityModelComponent' in module 'langflow.components.perplexity.perplexity'

(E0611)

src/backend/base/langflow/components/maritalk/__init__.py

[error] 1-1: No name 'MariTalkModel' in module 'langflow.components.maritalk.maritalk'

(E0611)

src/backend/base/langflow/components/sambanova/__init__.py

[error] 1-1: No name 'SambaNovaModelComponent' in module 'langflow.components.sambanova.sambanova'

(E0611)

🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/components/embeddings/__init__.py

[failure] 2-2: Ruff (TID252)
src/backend/base/langflow/components/embeddings/init.py:2:1: TID252 Prefer absolute imports over relative imports from parent modules


[failure] 1-1: Ruff (TID252)
src/backend/base/langflow/components/embeddings/init.py:1:1: TID252 Prefer absolute imports over relative imports from parent modules

🪛 Ruff (0.11.9)
src/backend/base/langflow/components/embeddings/__init__.py

1-1: Prefer absolute imports over relative imports from parent modules

Replace relative imports from parent modules with absolute imports

(TID252)


2-2: Prefer absolute imports over relative imports from parent modules

Replace relative imports from parent modules with absolute imports

(TID252)

🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/components/embeddings/__init__.py

[error] 1-1: Ruff TID252: Prefer absolute imports over relative imports from parent modules.

🔇 Additional comments (11)
src/backend/base/langflow/components/lmstudio/__init__.py (1)

1-4: Imports & __all__ look good

  • Alphabetical order of both imports and __all__ entries is correct (Embeddings before Model).
  • No stray symbols are leaked.

No further action required.

src/backend/base/langflow/components/cohere/cohere_models.py (1)

11-15: Check downstream references to the new display_name

Changing display_name to “Cohere Language Models” is harmless here, but double-check:

  1. Any frontend mapping that relies on an exact string match (tooltips, docs links, analytics).
  2. Tests that assert display_name.

If none exist, you’re good to go.

src/backend/base/langflow/components/xai/__init__.py (1)

1-3: Single-purpose re-export is correct

Nothing to add—import is alphabetical (single item) and __all__ is consistent.

src/backend/base/langflow/components/novita/__init__.py (1)

1-3: Public API looks good

Single export, correctly named, matches the component implementation shown in novita.py. No issues spotted.

src/backend/base/langflow/components/deepseek/__init__.py (1)

1-3: Component correctly re-exported

DeepSeekModelComponent exists in deepseek.py; the re-export complies with our packaging guideline. ✅

src/backend/base/langflow/components/cloudflare/__init__.py (1)

1-3: Re-export aligns with new package structure

CloudflareWorkersAIEmbeddingsComponent is present in cloudflare.py; the __all__ list is accurate. Good job.

src/backend/base/langflow/components/mem0/__init__.py (1)

1-3: Mem0 component exposed correctly

Import path and __all__ entry are consistent with mem0_chat_memory.py.

src/backend/base/langflow/components/mistral/__init__.py (1)

4-4: LGTM - all list is correctly alphabetized.

The export list follows alphabetical ordering as required by the coding guidelines.

src/backend/base/langflow/components/cohere/__init__.py (1)

5-5: LGTM - all list is correctly alphabetized.

The export list follows alphabetical ordering as required by the coding guidelines.

src/backend/base/langflow/components/embeddings/__init__.py (1)

6-11: LGTM - Export list correctly reflects the component reorganization.

The all list properly exports the remaining components after the migration of CohereEmbeddingsComponent and LMStudioEmbeddingsComponent to their dedicated packages.

src/frontend/src/utils/styleUtils.ts (1)

230-289: LGTM - Frontend sidebar correctly reflects backend component reorganization.

The SIDEBAR_BUNDLES updates properly align with the backend component package restructuring. The new entries for components like Baidu, Cloudflare, DeepSeek, Groq, LMStudio, MariTalk, Mem0, MistralAI, Novita, OpenRouter, Perplexity, Redis, SambaNova, xAI, and Zep correspond to the newly introduced backend component packages with their own __init__.py files.

The structure is consistent across all entries, maintaining the required display_name, name, and icon properties. This change supports the modularization effort described in the PR objectives for sidebar experience improvement.

Comment on lines 1 to 3
from .sambanova import SambaNovaModelComponent

__all__ = ["SambaNovaModelComponent"]
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Import likely to fail – symbol not found

Pylint flags SambaNovaModelComponent as missing from .sambanova. If the class is actually named differently (e.g., SambaNovaComponent) or lives in another file, every import langflow.components.sambanova will raise at import-time, breaking the entire package initialisation.

-from .sambanova import SambaNovaModelComponent
+# Adjust the module / symbol to the real name or location
+from .sambanova_model import SambaNovaModelComponent  # example

Please verify the real class name & path across the repo.


🏁 Script executed:

#!/bin/bash
# Confirm the symbol exists exactly once
rg -n $'class\\s+SambaNovaModelComponent' | head

Length of output: 48


🏁 Script executed:

#!/bin/bash
# List files in the sambanova component directory and show class definitions
echo "Files in sambanova directory:"
ls src/backend/base/langflow/components/sambanova
echo

echo "Class definitions in sambanova files:"
rg -n "class " src/backend/base/langflow/components/sambanova/*.py || true
echo

echo "Occurrences of ‘SambaNova’ across the repo:"
rg -n "SambaNova" . || true

Length of output: 4461


Fix import in sambanova init.py to use the real class name

The __init__.py in components/sambanova is importing SambaNovaModelComponent, but the class defined in sambanova.py is actually named SambaNovaComponent. This will cause all imports of this package to fail at startup.

• Location: src/backend/base/langflow/components/sambanova/__init__.py
• Change the import and __all__ to reference SambaNovaComponent

Proposed diff:

-from .sambanova import SambaNovaModelComponent
-__all__ = ["SambaNovaModelComponent"]
+from .sambanova import SambaNovaComponent
+
+__all__ = ["SambaNovaComponent"]

After this change, verify that all downstream imports (e.g., in model_input_constants.py) continue to use SambaNovaComponent.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from .sambanova import SambaNovaModelComponent
__all__ = ["SambaNovaModelComponent"]
from .sambanova import SambaNovaComponent
__all__ = ["SambaNovaComponent"]
🧰 Tools
🪛 Pylint (3.3.7)

[error] 1-1: No name 'SambaNovaModelComponent' in module 'langflow.components.sambanova.sambanova'

(E0611)

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/sambanova/__init__.py lines 1 to 3, the
import and __all__ list incorrectly reference SambaNovaModelComponent instead of
the actual class name SambaNovaComponent defined in sambanova.py. Update both
the import statement and the __all__ list to use SambaNovaComponent. After
making this change, verify that all downstream imports, such as those in
model_input_constants.py, also use SambaNovaComponent to avoid import errors.

Comment on lines 1 to 3
from .perplexity import PerplexityModelComponent

__all__ = ["PerplexityModelComponent"]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Import path may be wrong – static analysis can’t find PerplexityModelComponent

Pylint error E0611: No name 'PerplexityModelComponent' in module 'langflow.components.perplexity.perplexity' suggests the class lives in a differently named module (e.g. perplexity_model.py).

Proposed fix – adjust the import to the actual file name:

-from .perplexity import PerplexityModelComponent
+from .perplexity_model import PerplexityModelComponent

(or whichever module houses the class).

Please verify the module name and update tests accordingly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from .perplexity import PerplexityModelComponent
__all__ = ["PerplexityModelComponent"]
from .perplexity_model import PerplexityModelComponent
__all__ = ["PerplexityModelComponent"]
🧰 Tools
🪛 Pylint (3.3.7)

[error] 1-1: No name 'PerplexityModelComponent' in module 'langflow.components.perplexity.perplexity'

(E0611)

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/perplexity/__init__.py at lines 1 to 3,
the import statement for PerplexityModelComponent uses an incorrect module path
causing a pylint E0611 error. Verify the actual module file where
PerplexityModelComponent is defined (likely perplexity_model.py or similar),
then update the import statement to import from that correct module. Also,
update any related tests to reflect the corrected import path.

Comment on lines 1 to 3
from .maritalk import MariTalkModel

__all__ = ["MariTalkModel"]
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Import path/Class name appears wrong – module will raise at import-time

pylint reports that MariTalkModel cannot be found inside langflow.components.maritalk.maritalk. Either the file is not named maritalk.py or the class is defined under a different name. The package will fail to import and break any runtime that references langflow.components.maritalk.

-from .maritalk import MariTalkModel
+# FIXME: adjust the module name to where MariTalkModel is actually defined
+# from .mari_talk_model import MariTalkModel

Run the quick scan below to locate the correct definition and update the import accordingly:


🏁 Script executed:

#!/bin/bash
# Locate the real definition of MariTalkModel
rg -n --heading $'^class\s+MariTalkModel\b'

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Inspect the maritalk component directory for file names and class definitions
COMP_DIR="src/backend/base/langflow/components/maritalk"

echo "1) Listing all Python files in $COMP_DIR"
fd -e py . "$COMP_DIR"

echo -e "\n2) Showing all class definitions in $COMP_DIR"
rg -n "class " "$COMP_DIR"

echo -e "\n3) Searching for any 'MariTalk' references in $COMP_DIR"
rg -n "MariTalk" "$COMP_DIR"

Length of output: 1196


Incorrect import in maritalk component – update to match class name

The __init__.py is importing MariTalkModel, but the class is actually defined as MaritalkModelComponent in maritalk.py. Please update the import and __all__ accordingly.

• File: src/backend/base/langflow/components/maritalk/init.py

-from .maritalk import MariTalkModel
-__all__ = ["MariTalkModel"]
+from .maritalk import MaritalkModelComponent
+__all__ = ["MaritalkModelComponent"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from .maritalk import MariTalkModel
__all__ = ["MariTalkModel"]
from .maritalk import MaritalkModelComponent
__all__ = ["MaritalkModelComponent"]
🧰 Tools
🪛 Pylint (3.3.7)

[error] 1-1: No name 'MariTalkModel' in module 'langflow.components.maritalk.maritalk'

(E0611)

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/maritalk/__init__.py at lines 1 to 3,
the import statement and __all__ list incorrectly reference MariTalkModel, but
the actual class name in maritalk.py is MaritalkModelComponent. Update the
import to import MaritalkModelComponent from .maritalk and change the __all__
list to ["MaritalkModelComponent"] to match the correct class name.

Comment on lines 1 to 2
from ..cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
from ..mistral.mistral_embeddings import MistralAIEmbeddingsComponent
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix relative import violations by using absolute imports.

The static analysis tools are correctly flagging TID252 violations. Relative imports from parent modules should be replaced with absolute imports for better maintainability and clarity.

Apply this diff to fix the import violations:

-from ..cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
-from ..mistral.mistral_embeddings import MistralAIEmbeddingsComponent
+from langflow.components.cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
+from langflow.components.mistral.mistral_embeddings import MistralAIEmbeddingsComponent
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from ..cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
from ..mistral.mistral_embeddings import MistralAIEmbeddingsComponent
from langflow.components.cloudflare.cloudflare import CloudflareWorkersAIEmbeddingsComponent
from langflow.components.mistral.mistral_embeddings import MistralAIEmbeddingsComponent
🧰 Tools
🪛 GitHub Check: Ruff Style Check (3.13)

[failure] 2-2: Ruff (TID252)
src/backend/base/langflow/components/embeddings/init.py:2:1: TID252 Prefer absolute imports over relative imports from parent modules


[failure] 1-1: Ruff (TID252)
src/backend/base/langflow/components/embeddings/init.py:1:1: TID252 Prefer absolute imports over relative imports from parent modules

🪛 Ruff (0.11.9)

1-1: Prefer absolute imports over relative imports from parent modules

Replace relative imports from parent modules with absolute imports

(TID252)


2-2: Prefer absolute imports over relative imports from parent modules

Replace relative imports from parent modules with absolute imports

(TID252)

🪛 GitHub Actions: Ruff Style Check

[error] 1-1: Ruff TID252: Prefer absolute imports over relative imports from parent modules.

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/embeddings/__init__.py at lines 1 to 2,
replace the relative imports of CloudflareWorkersAIEmbeddingsComponent and
MistralAIEmbeddingsComponent with their absolute import paths. Change the import
statements to use the full module path from the project root instead of using
'..' to navigate up directories, ensuring compliance with import style
guidelines and improving code clarity.

@edwinjosechittilappilly
Copy link
Collaborator Author

edwinjosechittilappilly commented Jul 2, 2025

@ogabrielluiz @mfortman11 @coderabbitai May I know however, I tr,y the agent category is missing,

Solved

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@edwinjosechittilappilly Let me check the current state of the sidebar bundles and search for any agent-related categories that might be missing.


🏁 Script executed:

#!/bin/bash
# Check the current SIDEBAR_BUNDLES array in styleUtils.ts
echo "=== Current SIDEBAR_BUNDLES array ==="
cat src/frontend/src/utils/styleUtils.ts | grep -A 200 "SIDEBAR_BUNDLES"

echo -e "\n=== Searching for agent-related entries ==="
# Search for any references to "agent" (case insensitive) in the SIDEBAR_BUNDLES
grep -i "agent" src/frontend/src/utils/styleUtils.ts || echo "No agent entries found in SIDEBAR_BUNDLES"

echo -e "\n=== Searching for agent-related components in the codebase ==="
# Search for agent-related components that might need to be in the sidebar
find src -name "*.py" -path "*/components/*" | xargs grep -l -i "agent" | head -10

echo -e "\n=== Searching for agent directories in components ==="
# Look for agent-related directories in the components folder
find src/backend/base/langflow/components -type d -name "*agent*" -o -name "*Agent*"

Length of output: 9683


Let me check what's in the agents directory and compare the current sidebar bundles with what should be there:

Now I can see the issue! Looking at the output:

  1. The "Agents" bundle is missing from SIDEBAR_BUNDLES: In the current SIDEBAR_BUNDLES array, there's no entry for { display_name: "Agents", name: "agents", icon: "Bot" }, even though:

    • There are agent-related components in src/backend/base/langflow/components/agents/
    • The categoryIcons object includes agents: "Bot"
    • There are color mappings for agents in the file
  2. The components exist: There's clearly an agents directory with components that should be accessible through the sidebar.

@edwinjosechittilappilly You're absolutely right! The "Agents" category is indeed missing from the SIDEBAR_BUNDLES array. Looking at the code, I can see that:

  1. The agents category should be there: The categoryIcons object includes agents: "Bot", and there are agent-related components in src/backend/base/langflow/components/agents/

  2. It was likely accidentally removed: During the extensive reordering of the SIDEBAR_BUNDLES array, the { display_name: "Agents", name: "agents", icon: "Bot" } entry appears to have been removed.

  3. AgentQL is there but not general Agents: While "AgentQL" is present in the bundles, the general "Agents" category is missing.

You should add back the Agents entry to the SIDEBAR_BUNDLES array in src/frontend/src/utils/styleUtils.ts. It should be something like:

{ display_name: "Agents", name: "agents", icon: "Bot" },

This entry should be added to the SIDEBAR_BUNDLES array at an appropriate location (perhaps alphabetically after "AI/ML" and before "Amazon", or wherever you think it fits best in your organization scheme).


🏁 Script executed:

#!/bin/bash
# Check what's in the agents directory
echo "=== Contents of agents directory ==="
ls -la src/backend/base/langflow/components/agents/
echo -e "\n=== Contents of agents __init__.py ==="
cat src/backend/base/langflow/components/agents/__init__.py 2>/dev/null || echo "No __init__.py found in agents directory"

echo -e "\n=== Check if agents bundle should be in SIDEBAR_BUNDLES ==="
# Look for the specific line that should include Agents
grep -n "Agents" src/frontend/src/utils/styleUtils.ts

echo -e "\n=== Compare with other category mappings ==="
# Check the categoryIcons to see what categories are expected
echo "CategoryIcons entries:"
grep -A 50 "export const categoryIcons" src/frontend/src/utils/styleUtils.ts | grep "agents"

Length of output: 1267


Interesting! The grep shows there IS an "Agents" entry on line 209. Let me check the exact context to see where this appears:

@edwinjosechittilappilly It looks like there might be some confusion here. According to the grep results, there IS an "Agents" entry in the file at line 209. Let me get the exact context to see where it appears and whether it's actually in the correct SIDEBAR_BUNDLES array or somewhere else in the file.


🏁 Script executed:

#!/bin/bash
# Get the context around line 209 to see exactly where "Agents" appears
echo "=== Context around line 209 ==="
sed -n '200,220p' src/frontend/src/utils/styleUtils.ts

echo -e "\n=== Check if Agents is actually in the SIDEBAR_BUNDLES array ==="
# Let's get the complete SIDEBAR_BUNDLES array with line numbers
grep -n "SIDEBAR_BUNDLES" src/frontend/src/utils/styleUtils.ts
echo -e "\n=== Get the exact range of SIDEBAR_BUNDLES array ==="
awk '/export const SIDEBAR_BUNDLES/,/^\];/' src/frontend/src/utils/styleUtils.ts | nl

echo -e "\n=== Double check - search for all instances of 'Agents' in the file ==="
grep -n "Agents" src/frontend/src/utils/styleUtils.ts

Length of output: 2037


Now I understand the confusion! Let me get the complete SIDEBAR_BUNDLES array to confirm:

@edwinjosechittilappilly Now I see what happened! There are two different arrays in the file:

  1. SIDEBAR_CATEGORIES (line 209) - This contains general categories like "Agents", "Models", "Data", etc.
  2. SIDEBAR_BUNDLES (line 230) - This contains provider/service-specific bundles like "AgentQL", "Amazon", "Anthropic", etc.

The "Agents" entry you're referring to is in SIDEBAR_CATEGORIES, not SIDEBAR_BUNDLES. These serve different purposes:

  • SIDEBAR_CATEGORIES: Component categories (Agents, Models, Data, etc.)
  • SIDEBAR_BUNDLES: Provider/service bundles (AgentQL, Amazon, Anthropic, etc.)

If you're looking for agents in the sidebar and they're not showing up, the issue might be:

  1. Frontend logic: The frontend might not be properly using the SIDEBAR_CATEGORIES array to display the "Agents" category
  2. Component registration: The agent components might not be properly registered to show up under the "Agents" category

Could you clarify which sidebar section you're expecting to see agents in? Are you looking for:

  • A general "Agents" category alongside "Models", "Data", etc.?
  • Or specific agent providers in the bundles list alongside "AgentQL", "Amazon", etc.?

This will help me better understand what exactly is missing and where it should appear.


🏁 Script executed:

#!/bin/bash
# Get the complete SIDEBAR_BUNDLES array
echo "=== Complete SIDEBAR_BUNDLES array ==="
awk '/export const SIDEBAR_BUNDLES = \[/,/^\];/' src/frontend/src/utils/styleUtils.ts

echo -e "\n=== The difference between SIDEBAR_CATEGORIES and SIDEBAR_BUNDLES ==="
echo "SIDEBAR_CATEGORIES contains:"
awk '/export const SIDEBAR_CATEGORIES = \[/,/^\];/' src/frontend/src/utils/styleUtils.ts | grep "display_name"

echo -e "\nSIDEBAR_BUNDLES contains:"
awk '/export const SIDEBAR_BUNDLES = \[/,/^\];/' src/frontend/src/utils/styleUtils.ts | grep "display_name" | head -10

Length of output: 7491


Perfect! Now I can see the complete picture. You're absolutely right to be concerned, but there's good news:

Summary of the situation:

The "Agents" category IS present - it's in SIDEBAR_CATEGORIES at line 209:

{ display_name: "Agents", name: "agents", icon: "Bot" },

Two different arrays serve different purposes:

  1. SIDEBAR_CATEGORIES - General component categories:

    • "Agents" (this is where agent components should appear)
    • "Models", "Data", "Vector Stores", etc.
  2. SIDEBAR_BUNDLES - Provider/service-specific bundles:

    • "AgentQL", "Amazon", "Anthropic", "Baidu", etc.
    • This is what your PR primarily modified

The issue might be:

Since the "Agents" category exists in the code but you're not seeing it in the UI, this could be:

  1. Frontend rendering issue - The UI might not be properly displaying the SIDEBAR_CATEGORIES
  2. Component registration issue - Agent components might not be properly registered under the "agents" category
  3. UI state issue - The agents category might be collapsed or hidden

Next steps:

Could you check:

  1. In the UI: Are you looking for agents in the general categories section (alongside Models, Data, etc.) or in the provider bundles section?
  2. Component visibility: Are the individual agent components (AgentComponent, MCPToolsComponent) visible when you search for them?

The "Agents" category definition is definitely there in the code, so if it's not showing up in the UI, there might be a frontend logic issue rather than a missing configuration.

@edwinjosechittilappilly
Copy link
Collaborator Author

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Tip

For best results, initiate chat on the files or code changes.

@edwinjosechittilappilly Great to hear that you've resolved the agent category issue! 🎉

Thanks for sharing the Loom video as well - that's helpful for context. It looks like you were able to identify and fix whatever was causing the agents to not appear properly in the sidebar.

Since you mentioned it's solved, I assume you either:

  • Located the agents in the correct category section (SIDEBAR_CATEGORIES vs SIDEBAR_BUNDLES)
  • Fixed any frontend logic that wasn't properly displaying the agents
  • Or made the necessary adjustments to ensure agent components are properly registered and visible

Is there anything else you'd like me to help you with regarding this sidebar refactoring PR?


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@edwinjosechittilappilly
Copy link
Collaborator Author

edwinjosechittilappilly and others added 3 commits July 2, 2025 11:33
…etter readability and efficiency

✨ (filterEdge-shard-1.spec.ts): Update model names for better clarity and consistency
🐛 (duckduckgo.spec.ts): Update selector for search button to match changes in the frontend
🐛 (generalBugs-shard-11.spec.ts): Update selector for search button to match changes in the frontend
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 2, 2025
@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Jul 2, 2025
@edwinjosechittilappilly edwinjosechittilappilly removed the DO NOT MERGE Don't Merge this PR label Jul 2, 2025
Merged via the queue into main with commit e280932 Jul 2, 2025
69 checks passed
@edwinjosechittilappilly edwinjosechittilappilly deleted the ref/sidebar branch July 2, 2025 20:26
dev-thiago-oliver pushed a commit to vvidai/langflow that referenced this pull request Jul 5, 2025
* cohere sidebar

* side bar embeddings

* move memories

* sort style utils

* [autofix.ci] apply automated fixes

* serach components add

* Update __init__.py

* Update styleUtils.ts

* [autofix.ci] apply automated fixes

* Update model_input_constants.py

* fix lint

* update to wikipedia

* ✨ (tableInputComponent.spec.ts): Refactor test to use for loops for better readability and efficiency
✨ (filterEdge-shard-1.spec.ts): Update model names for better clarity and consistency
🐛 (duckduckgo.spec.ts): Update selector for search button to match changes in the frontend
🐛 (generalBugs-shard-11.spec.ts): Update selector for search button to match changes in the frontend

* [autofix.ci] apply automated fixes

* update tests path

* update tests

* Update test_arxiv_component.py

* [autofix.ci] apply automated fixes

* make embeddings functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants