-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix: Knowledge base component refactor #9543
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
2a0dabd
fix: Knowledge base component refactor
erichare 78cd280
[autofix.ci] apply automated fixes
autofix-ci[bot] 84e6c05
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] b7d033b
Merge branch 'main' into fix-kb-adjustments
erichare 9f3fe45
Merge branch 'main' into fix-kb-adjustments
erichare def90ae
Merge branch 'main' into fix-kb-adjustments
edwinjosechittilappilly 29799fe
Update styleUtils.ts
erichare a050287
Update ingestion.py
erichare ba11333
Merge branch 'main' into fix-kb-adjustments
carlosrcoelho 9adc5cc
[autofix.ci] apply automated fixes
autofix-ci[bot] 9b90f04
Fix ingestion of df
erichare 95249d7
[autofix.ci] apply automated fixes
autofix-ci[bot] 338b4ce
Update Knowledge Ingestion.json
erichare 5b9d1a8
Fix one failing test
erichare dd61055
Merge branch 'main' into fix-kb-adjustments
erichare 88d6a4e
Merge branch 'main' into fix-kb-adjustments
erichare 585fc24
Merge branch 'release-1.6.0' into fix-kb-adjustments
erichare dfb2c4e
[autofix.ci] apply automated fixes
autofix-ci[bot] 4a05cdc
Merge branch 'release-1.6.0' into fix-kb-adjustments
erichare b512dbb
[autofix.ci] apply automated fixes
autofix-ci[bot] 9bcb694
Revert composio versions for CI
erichare ad7e5dd
Revert "Revert composio versions for CI"
erichare 00f5ccc
Merge branch 'release-1.6.0' into fix-kb-adjustments
erichare 6727a36
[autofix.ci] apply automated fixes
autofix-ci[bot] ea4ede2
Update Vector Store RAG.json
erichare 68faa9a
[autofix.ci] apply automated fixes
autofix-ci[bot] 47c5c68
Update starter-projects.spec.ts
erichare ec30942
Update starter-projects.spec.ts
erichare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/backend/base/langflow/components/knowledge_bases/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING, Any | ||
|
|
||
| from langflow.components._importing import import_mod | ||
|
|
||
| if TYPE_CHECKING: | ||
| from langflow.components.knowledge_bases.ingestion import KnowledgeIngestionComponent | ||
| from langflow.components.knowledge_bases.retrieval import KnowledgeRetrievalComponent | ||
|
|
||
| _dynamic_imports = { | ||
| "KnowledgeIngestionComponent": "ingestion", | ||
| "KnowledgeRetrievalComponent": "retrieval", | ||
| } | ||
|
|
||
| __all__ = ["KnowledgeIngestionComponent", "KnowledgeRetrievalComponent"] | ||
|
|
||
|
|
||
| def __getattr__(attr_name: str) -> Any: | ||
| """Lazily import input/output components on attribute access.""" | ||
| if attr_name not in _dynamic_imports: | ||
| msg = f"module '{__name__}' has no attribute '{attr_name}'" | ||
| raise AttributeError(msg) | ||
| try: | ||
| result = import_mod(attr_name, _dynamic_imports[attr_name], __spec__.parent) | ||
| except (ModuleNotFoundError, ImportError, AttributeError) as e: | ||
| msg = f"Could not import '{attr_name}' from '{__name__}': {e}" | ||
| raise AttributeError(msg) from e | ||
| globals()[attr_name] = result | ||
| return result | ||
|
|
||
|
|
||
| def __dir__() -> list[str]: | ||
| return list(__all__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Input handling misses list[DataFrame] support; can crash downstream.
The HandleInput advertises input_types ["Data", "DataFrame"] with is_list=True, but build_kb_info only handles Data, list[Data], or single DataFrame. Passing list[DataFrame] leaves df_source as a Python list, breaking validation and ingestion.
Apply this diff to support list[DataFrame] (and mixed Data/DataFrame lists defensively):
📝 Committable suggestion
🤖 Prompt for AI Agents