-
Notifications
You must be signed in to change notification settings - Fork 8.2k
feat: Add raw content output for File component #8515
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
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces a new "Raw Content" output to the "File" component across several starter project configurations and implements the corresponding Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FileComponent
participant BaseFileComponent
User->>FileComponent: Request file loading (select output)
alt DataFrame output
FileComponent->>BaseFileComponent: load_files()
BaseFileComponent-->>FileComponent: DataFrame
else Raw Content output
FileComponent->>BaseFileComponent: load_files_message()
BaseFileComponent-->>FileComponent: Message (concatenated file content)
end
FileComponent-->>User: Return selected output
sequenceDiagram
participant User
participant MemoryComponent
User->>MemoryComponent: Retrieve messages (select output)
alt DataFrame output
MemoryComponent->>MemoryComponent: retrieve_messages()
MemoryComponent-->>User: DataFrame
else Message output
MemoryComponent->>MemoryComponent: retrieve_messages_as_text()
MemoryComponent-->>User: Message (formatted text)
end
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/backend/base/langflow/base/data/base_file.py (1)
176-179: Name collision & discoverability risk for new output
name="message"is very generic and likely to overlap with other components’ outputs (e.g. chat-oriented nodes already expose “message”).
When graph-building UIs auto-complete onname, this can lead to ambiguous wiring.Consider a more explicit identifier such as
raw_messageorraw_content_messageto avoid collisions and make intent clearer.src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (3)
856-865: Ensure clear labeling for the new message output
The new"messages_text"output correctly invokesretrieve_messages_as_text, but usingdisplay_name: "Message"may be ambiguous alongside other message outputs. Consider renaming it to"Messages Text"or"Message History (Text)"to align thedisplay_namewith thenameand avoid UI confusion.
1007-1009: Explicit default forsenderinput
The updatedsenderinput now allows an empty value to fallback to the current sender, but the template field lacks an explicit"value": "". Adding this default will make the UI behavior clear and consistent.
1047-1071: Verify and simplifysender_typedropdown
The newsender_typedropdown covers Machine, User, and Machine-and-User as expected and maps correctly toNonein the backend when “Machine and User” is selected. For brevity, consider renaming that option to"Both"in the dropdown.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/backend/base/langflow/base/data/base_file.py(2 hunks)src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json(4 hunks)src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json(5 hunks)src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/backend/base/langflow/base/data/base_file.py (2)
src/backend/base/langflow/template/field/base.py (1)
Output(181-257)src/backend/base/langflow/schema/message.py (1)
Message(38-288)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Optimize new Python code in this PR
🔇 Additional comments (8)
src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json (1)
1827-1840: Add ‘Raw Content’ output entry
This new output correctly mirrors other starter-project configs, usingload_files_messageto emit aMessagetype alongside the existing DataFrame output. Caching, loop allowances, and tool-mode flags are consistent and ordering is valid.src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json (1)
2408-2422: Properly configured Raw Content output
The new "Raw Content" output entry correctly referencesload_files_message, enables caching, disallows loops, and aligns with the schema in other starter projects. This addition looks solid and consistent.src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (1)
815-829: Configuration correct for new "Raw Content" outputThe new output is properly defined with display_name
"Raw Content", methodload_files_message, name"message", and type"Message", matching the backend implementation.src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json (4)
183-187: Approve addition ofoutput_typesfor the File component edge.The new
"output_types": ["Message"]entry on the File→OpenAIModel edge correctly exposes the “Raw Content” output for downstream routing. This aligns with the newly addedload_files_messageoutput.
214-216: Approve addition ofoutput_typesfor the File component edge.The
"output_types": ["Message"]on the File→Prompt edge is consistent with supporting raw file content as aMessage. This ensures the graph can connect the new output to prompt templates.
228-230: Approve updatedsourceHandlefor the File component edge.The expanded
sourceHandlestring now includes"output_types":["Message"], matching the File component’s new raw content output. This maintains schema consistency for all edge definitions.
281-294: Approve addition of “Raw Content” output in the File node.The new output block—display name “Raw Content”, method
load_files_message, typeMessage—correctly declares the raw content option alongside the existing DataFrame output. This mirrors the backend implementation inBaseFileComponent.src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)
867-869: Caching added to DataFrame output looks good
Introducing"cache": truefor the existing DataFrame output will improve performance by reusing retrieved data across renders. No issues found here.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
edwinjosechittilappilly
left a comment
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
* Add raw content output for File component * Update src/backend/base/langflow/base/data/base_file.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]>
* Add raw content output for File component * Update src/backend/base/langflow/base/data/base_file.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Edwin Jose <[email protected]>
This pull request adds a raw message output of the raw file data to the output of the Files component.
Summary by CodeRabbit