-
Notifications
You must be signed in to change notification settings - Fork 7k
fix: re-added message store component output dropdown #8399
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce enhanced output handling for the Memory component, supporting multiple output formats (raw data, formatted text, DataFrame) and a new method for retrieving messages as formatted text. Output selection logic is refactored, removing the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MemoryComponent
participant ExternalMemory
User->>MemoryComponent: Retrieve messages (mode = "Retrieve")
alt Output: messages (raw)
MemoryComponent->>ExternalMemory: aget_messages()
ExternalMemory-->>MemoryComponent: messages (raw data)
MemoryComponent-->>User: messages (raw data)
else Output: messages_text (formatted)
MemoryComponent->>ExternalMemory: aget_messages()
ExternalMemory-->>MemoryComponent: messages (raw data)
MemoryComponent->>MemoryComponent: Format messages as text (data_to_text)
MemoryComponent-->>User: Message (formatted text)
else Output: dataframe
MemoryComponent->>ExternalMemory: aget_messages()
ExternalMemory-->>MemoryComponent: messages (raw data)
MemoryComponent->>MemoryComponent: Convert to DataFrame
MemoryComponent-->>User: DataFrame
end
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches
🪧 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
CodeRabbit Configuration File (
|
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.
Pull Request Overview
This PR reintroduces the message store component’s output dropdown in both code and configuration.
- Updates frontend test selectors to click the first matching dropdown and item.
- Enhances MemoryComponent with three distinct output methods (
Data
,Message
,DataFrame
) and addsretrieve_messages_as_text
. - Updates starter-project JSONs (
Memory Chatbot.json
andCustom Component Maker.json
) with new node/edge IDs and aligned output definitions.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts | Adjusted test selectors to .first() on dropdowns |
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json | Updated node/edge IDs and added new output configs |
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json | Replaced IDs for nodes/edges and removed legacy paths |
src/backend/base/langflow/components/helpers/memory.py | Imported data_to_text , added outputs for text/Data |
Comments suppressed due to low confidence (1)
src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts:92
- With the addition of 'Data' and 'DataFrame' output options in MemoryComponent, consider adding test steps that open the dropdown and select those items as well to ensure full coverage of the new outputs.
await page.getByTestId("dropdown-output-memory").first().click();
Co-authored-by: Copilot <[email protected]>
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
♻️ Duplicate comments (1)
src/backend/base/langflow/components/helpers/memory.py (1)
124-126
: Add missingdynamic=True
for consistency.The outputs in the
update_outputs
method are missing thedynamic=True
flag that's present in the class-level outputs definition. This inconsistency could lead to unexpected UI behavior.Apply this diff to maintain consistency:
- Output(display_name="Data", name="messages", method="retrieve_messages"), - Output(display_name="Message", name="messages_text", method="retrieve_messages_as_text"), - Output(display_name="DataFrame", name="dataframe", method="retrieve_messages_dataframe"), + Output(display_name="Data", name="messages", method="retrieve_messages", dynamic=True), + Output(display_name="Message", name="messages_text", method="retrieve_messages_as_text", dynamic=True), + Output(display_name="DataFrame", name="dataframe", method="retrieve_messages_dataframe", dynamic=True),
🧹 Nitpick comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)
1380-1403
: MemoryComponent outputs expanded.
TheMemory
node now exposes three outputs—Data
(messages
),Message
(messages_text
), andDataFrame
(dataframe
). This aligns with the enhancedMemoryComponent
API; ensure documentation snippets and example flows are updated to demonstrate selecting each output type.src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (1)
2640-2646
: Implementation ofretrieve_messages_as_text
The new asynchronous method correctly usesdata_to_text(self.template, await self.retrieve_messages())
and wraps the result in aMessage
. Consider adding error handling for empty or malformed message lists to prevent runtime failures in downstream components.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/frontend/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (9)
src/backend/base/langflow/components/helpers/memory.py
(4 hunks)src/backend/base/langflow/custom/custom_component/component.py
(0 hunks)src/backend/base/langflow/custom/utils.py
(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json
(27 hunks)src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
(42 hunks)src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
(18 hunks)src/backend/base/langflow/template/field/base.py
(0 hunks)src/backend/tests/unit/test_schema.py
(0 hunks)src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts
(1 hunks)
💤 Files with no reviewable changes (3)
- src/backend/tests/unit/test_schema.py
- src/backend/base/langflow/template/field/base.py
- src/backend/base/langflow/custom/custom_component/component.py
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Optimize new Python code in this PR
- GitHub Check: Run Ruff Check and Format
- GitHub Check: Update Starter Projects
🔇 Additional comments (41)
src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts (1)
92-92
: Good defensive test programming.Adding
.first()
ensures the test selects the intended dropdown element when multiple outputs are available, which aligns with the enhanced MemoryComponent that now exposes multiple output formats.Also applies to: 94-97
src/backend/base/langflow/custom/utils.py (1)
383-388
: Improved output selection handling.The explicit approach of finding the selected output from configuration and setting the
selected
attribute directly is cleaner than the previous method-based approach.src/backend/base/langflow/components/helpers/memory.py (3)
4-4
: Good addition of required import.The
data_to_text
import is necessary for the new text formatting functionality.
101-105
: LGTM! Multiple output formats enhance component flexibility.The three output formats (Data, Message, DataFrame) provide good flexibility for different use cases. All outputs correctly include
dynamic=True
.
172-175
: Well-implemented text formatting method.The new
retrieve_messages_as_text
method correctly:
- Uses async/await for the retrieval operation
- Formats data using the component's template
- Updates component status
- Returns properly wrapped result
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (20)
10-31
: Edge ID and handles updated correctly for URL → Prompt mappingThe new unique edge ID and handle strings follow the established pattern and align the URL-raIKe node’s
text
output with the Prompt component’sEXAMPLE_COMPONENTS
input.
39-61
: Edge ID and handles updated correctly for second URL → Prompt mappingConsistent with the previous edge update, the URL-j5F0d
text
output now correctly connects to theBASE_COMPONENT_CODE
input of the Prompt node.
68-89
: Edge ID and handles updated correctly for third URL → Prompt mappingThe URL-JjyEG node’s
text
output is now properly linked to theCUSTOM_COMPONENT_CODE
input of the Prompt node with a unique edge ID.
105-118
: Edge updated for Prompt → Anthropic Model mappingThe Prompt component’s
prompt
output now correctly connects to the AnthropicModel’sinput_value
field with a new unique edge ID.
142-147
: Edge updated for Anthropic Model → Chat Output mappingThe AnthropicModel’s
text_output
now routes to the ChatOutput component’sinput_value
, and the edge ID is updated accordingly.
171-176
: Edge updated for ChatInput → Prompt mappingThe ChatInput component’s
message
output is now linked to the Prompt node’sUSER_INPUT
input with a refreshed edge ID.
244-252
: Memory outputs: confirm Data output definitionThe
messages
output is correctly defined as a Data type with caching enabled and proper method linkage.
254-267
: Memory outputs: confirm Message output definitionThe
messages_text
output is correctly added, and set as the default selected Message format.
499-506
: Memory node repositioned with new IDThe Memory component node has been assigned a new unique ID (
Memory-XWOq3
) and repositioned. The ID matches the updated edge definitions.
520-520
: Prompt node ID updated consistentlyThe Prompt component node’s ID (
Prompt-sBJbI
) is refreshed to align with the revised graph references.
767-767
: Note node ID changedNote IDs have been regenerated (
note-i6i1L
). No functional impact on component logic.
797-797
: Note node repositioned and ID updatedThe second note node (
note-BOaIr
) has an updated ID and coordinates. This only affects layout.Also applies to: 815-816
832-832
: URL-j5F0d node ID refreshedThe URL component instance ID has been updated for uniqueness.
1024-1024
: URL-raIKe node ID refreshedThe URL component instance ID has been updated for uniqueness.
1222-1222
: URL-JjyEG node ID refreshedThe URL component instance ID has been updated for uniqueness.
1501-1501
: AnthropicModel API key: enableload_from_db
Setting
load_from_db: true
is correct for sourcing the API key from the database by default.
1510-1510
: AnthropicModel API key default value setThe API key field now defaults to
"ANTHROPIC_API_KEY"
, matching the new secure default.
1752-1752
: AnthropicModel node selected by defaultMarking the AnthropicModel node as
selected: true
aligns with the updated tool preference.
1478-1478
:✅ Verification successful
Verify inclusion of
options
field in outputsThe
options: null
property has been added to AnthropicModel’s second output. Please ensure consistency with frontend expectations.
🏁 Script executed:
#!/bin/bash # Verify if `options` is used in other starter project JSONs rg -n '"options": null' -A2 src/backend/base/langflow/initial_setup/starter_projectsLength of output: 7444
No changes required:
options
field is consistent across starter projects
A search shows"options": null
appears in every starter project JSON undersrc/backend/base/langflow/initial_setup/starter_projects
(e.g. Custom Component Maker at lines 1462/1478, Youtube Analysis at 2361, Travel Planning Agents at 1016/1268/1421, etc.). The new entry in Custom Component Maker follows this pattern. Please ensure the frontend gracefully handlesoptions: null
, but no code changes are needed here.
1462-1462
:❓ Verification inconclusive
Verify inclusion of
options
field in outputsThe
options: null
property has been added to AnthropicModel’s first output. Confirm this field is supported by the JSON schema and does not break output rendering.
🏁 Script executed:
#!/bin/bash # Verify if `options` is used in other starter project JSONs rg -n '"options": null' -A2 src/backend/base/langflow/initial_setup/starter_projectsLength of output: 7444
🏁 Script executed:
#!/bin/bash # List JSON files under initial_setup directory to locate schema definitions find src/backend/base/langflow/initial_setup -maxdepth 1 -type f -name '*.json'Length of output: 81
Consistent
options
field across starter projects
The"options": null
property appears in 15 JSON files undersrc/backend/base/langflow/initial_setup/starter_projects
, so its inclusion here matches the existing pattern.• No immediate fix required in this file.
• Please confirm that your JSON‐loading logic or schema validation includes (or tolerates) anoptions
field on outputs to avoid runtime errors.
• If there is a centralized JSON schema for these starter definitions, ensure it allows an"options": null
entry (or update it accordingly).src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (13)
10-10
: Check edge mapping for ChatInput to OpenAIModel.
The updated edge IDs and handle payloads forChatInput-AUcQG
→OpenAIModel-XoX0N
correctly reflect the regenerated node identifiers. Confirm that the serializedsourceHandle
andtargetHandle
strings align with the runtime ReactFlow schema to avoid mismatches at graph render time.Also applies to: 25-30
38-38
: Validate Prompt→OpenAIModel edge updates.
The edge connectingPrompt-obNrd.prompt
toOpenAIModel-XoX0N.system_message
has been re-generated. Input types andfieldName
remain correct, but please verify that downstream code consuming thesystem_message
input still functions as expected with the new edge ID.Also applies to: 46-46, 53-53, 55-58
67-67
: Review OpenAIModel→ChatOutput edge changes.
This edge now exposes all three input types (Data
,DataFrame
,Message
) onChatOutput-ui0vL.input_value
, matching the component’s expanded multi-type support. Ensure the frontend dropdown and handler logic correctly present and handle these options.Also applies to: 75-75, 83-83, 85-89
94-97
: Inspect Memory→Prompt edge for new text output.
TheMemory-eFLbY.messages_text
output is now wired intoPrompt-obNrd.memory
withinputTypes
[“Message”, “Text”]
. Verify that “Text” is recognized by the Prompt component’s input schema (it previously accepted onlyMessage
) and that conversion logic produces the intended plain-text context.Also applies to: 103-116
122-123
: ChatInput node ID updated.
NodeChatInput-AUcQG
ID changed—ensure any saved templates or automated tests referencing the old ID are updated accordingly.
427-428
: ChatOutput node ID updated.
NodeChatOutput-ui0vL
ID has been regenerated. Confirm no broken links in starter projects or regression tests rely on the previous identifier.
729-730
: Note nodenote-vPnjW
ID regeneration.
Auto-generated note node ID change; no schema impact.
764-765
: Note nodenote-TCLyL
ID regeneration.
Another auto-generated note node—no action required.
796-797
: Prompt node ID updated.
Prompt-obNrd
ID has changed; update any scripts or fixtures referring to this node.
952-953
: OpenAIModel node ID updated.
IdentifierOpenAIModel-XoX0N
was regenerated. Verify that project references and config integrations use this new ID.
1437-1440
: Confirm code template for MemoryComponent.
Thecode
template value now importsdata_to_text
and definesretrieve_messages_as_text
. Please verify that the import path (langflow.helpers.data
) and helper signature match the current helper implementation to avoid runtime import errors.
1651-1656
: Skip auto-generated measured and position changes.
Updates tomeasured
,position
, andviewport
reflect UI layout adjustments and require no manual review.
1670-1671
: Project ID updated.
Top-level JSONid
changed—if any CI or sharing URLs reference the old ID, they should be updated.src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (3)
263-292
: Re-addedmessages_text
edge for Memory → Prompt
This edge restores the connection from the Memory component’s newmessages_text
output to the Prompt’shistory
input. The linkage appears correct; ensure the UI dropdown for Memory outputs now includes “Message” and that the Prompt component can handle the incoming formatted text.
2489-2529
: Enhanced Memory component outputs
The Memory node now exposes three outputs—Data
(messages
),Message
(messages_text
), andDataFrame
(dataframe
)—allowing users to select the desired format. This aligns with the updatedoutputs
list inMemoryComponent
. Confirm that the builder UI reflects these options in the outputs dropdown and that backward compatibility is maintained for flows expecting only the originalData
output.
2532-2552
: Import ofdata_to_text
helper added
The template code now importsdata_to_text
fromlangflow.helpers.data
. Verify that this helper is available in the starter-project context and that its API matches the usage inretrieve_messages_as_text
.
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/frontend/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (9)
src/backend/base/langflow/components/helpers/memory.py
(4 hunks)src/backend/base/langflow/custom/custom_component/component.py
(0 hunks)src/backend/base/langflow/custom/utils.py
(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json
(27 hunks)src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
(42 hunks)src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
(18 hunks)src/backend/base/langflow/template/field/base.py
(0 hunks)src/backend/tests/unit/test_schema.py
(0 hunks)src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts
(1 hunks)
💤 Files with no reviewable changes (3)
- src/backend/tests/unit/test_schema.py
- src/backend/base/langflow/template/field/base.py
- src/backend/base/langflow/custom/custom_component/component.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/backend/base/langflow/components/helpers/memory.py (2)
src/backend/base/langflow/helpers/data.py (1)
data_to_text
(107-120)src/backend/base/langflow/schema/message.py (1)
Message
(38-288)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Optimize new Python code in this PR
- GitHub Check: Run Ruff Check and Format
- GitHub Check: Update Starter Projects
🔇 Additional comments (48)
src/frontend/tests/core/regression/generalBugs-shard-9.spec.ts (1)
92-97
: LGTM! Improved test reliability.The addition of
.first()
to element selection prevents potential test flakiness when multiple elements share the same test ID. This change aligns well with the enhanced MemoryComponent that now supports multiple output formats.src/backend/base/langflow/components/helpers/memory.py (4)
4-4
: LGTM! Good addition for text formatting functionality.The import of
data_to_text
enables the new text formatting capability in the component.
101-105
: Excellent! Multiple output formats now supported.The component now provides three output formats (Data, Message, DataFrame) with proper
dynamic=True
flags. This addresses the previous feedback about missing dynamic flags and significantly enhances the component's flexibility.
124-126
: LGTM! Consistent output handling in update_outputs.The dynamic output display logic correctly shows all three output formats when in "Retrieve" mode.
172-175
: Well-implemented text formatting method.The new
retrieve_messages_as_text
method efficiently reuses the existingretrieve_messages
functionality and properly formats the output using the template. The status update and Message object creation are handled correctly.src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (9)
39-61
: Verify edge mappings for URL-j5F0d → Prompt
Similar to the first URL edge, ensure that every instance ofURL-j5F0d
insource
,sourceHandle
, and the edge ID references an existing node. This consistency is crucial for the flow to render correctly.You can reuse the above script replacing
URL-raIKe
withURL-j5F0d
.
1499-1511
: Load Anthropic API key from database by default
Theapi_key
field in theAnthropicModel-BC7GB
node template has"load_from_db": true
and default value"ANTHROPIC_API_KEY"
. This correctly reflects the PR’s goal of using DB-stored credentials.
212-1498
: Skip: Node ID and position updates
The remainder of changes are unique identifier updates, node positions, viewport settings, and other non-functional metadata adjustments. No further review is needed for these segments.Also applies to: 1512-2386
69-90
:✅ Verification successful
Verify edge mappings for URL-JjyEG → Prompt
The third URL edge usesURL-JjyEG
. Confirm that the new ID is correctly registered in the nodes section and that the frontend will be able to resolve the serialized handle object.
🏁 Script executed:
rg -n '"id": "URL-JjyEG"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.json rg -n '"source": "URL-JjyEG"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 373
Edge mapping for URL-JjyEG → Prompt verified
- Ripgrep results show
"id": "URL-JjyEG"
in the nodes section at lines 68, 1222, and 1395.- The edge source
"source": "URL-JjyEG"
appears at line 86.
The node ID is correctly registered and the serialized handle object will resolve in the frontend as expected.
244-281
:✅ Verification successful
Memory node outputs updated to three formats
TheMemory-XWOq3
node now declares three outputs—Data
,Message
, andDataFrame
—matching the updatedMemoryComponent
API. The default selected output isMessage
. This aligns with the component class enhancements (newretrieve_messages_as_text
and DataFrame support).Please verify that these JSON definitions exactly mirror the
outputs
list insrc/backend/base/langflow/components/helpers/memory.py
:
🏁 Script executed:
ast-grep --pattern $'class MemoryComponent { $$$ outputs = [Output(display_name="Data", ...), Output(display_name="Message", ...), Output(display_name="DataFrame", ...)] $$$ }' src/backend/base/langflow/components/helpers/memory.py
Length of output: 232
Let’s locate and inspect the
MemoryComponent
definition and its outputs in the source to confirm alignment:
🏁 Script executed:
#!/bin/bash # 1. Find the MemoryComponent class rg "class MemoryComponent" -n src/backend/base/langflow/components/helpers/memory.py # 2. Locate where `outputs` is assigned or defined rg "outputs\s*=" -n src/backend/base/langflow/components/helpers/memory.py # 3. List all Output instantiations to see their parameters rg "Output\(" -n src/backend/base/langflow/components/helpers/memory.pyLength of output: 984
Outputs alignment verified for MemoryComponent
The three outputs (Data
,Message
,DataFrame
) inCustom Component Maker.json
exactly match theMemoryComponent
definition insrc/backend/base/langflow/components/helpers/memory.py
(lines 102–104 & 124–126). No further changes are required.
179-205
:✅ Verification successful
Verify edge mappings for Memory → Prompt
A new edgexy-edge__Memory-XWOq3…-Prompt-sBJbI
maps themessages_text
output toCHAT_HISTORY
. EnsureMemory-XWOq3
is present as a node ID, and thePrompt
node’sCHAT_HISTORY
placeholder is correctly configured to accept"Message"
input.
🏁 Script executed:
rg -n '"id": "Memory-XWOq3"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.json rg -n '"fieldName": "CHAT_HISTORY"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 401
🏁 Script executed:
#!/bin/bash rg -A5 -B5 '"id": "Prompt-sBJbI"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 2629
Edge mapping Memory → Prompt verified
- Node
Memory-XWOq3
is present (IDs at lines 183, 212, 499).Prompt-sBJbI
’sCHAT_HISTORY
targetHandle accepts"Message"
(inputTypes include"Message"
, lines 189–196).No further action required.
10-31
:✅ Verification successful
Verify edge mappings for URL → Prompt
The edges connectingURL-raIKe
toPrompt-sBJbI
have been updated with new unique IDs and serialized handle objects. Confirm that these new IDs align with the actual node IDs and that the serializedsourceHandle
/targetHandle
strings are correctly parsed by the frontend.Run:
🏁 Script executed:
#!/bin/bash # Verify that the edge source/target IDs match existing nodes. rg -n '"source": "URL-raIKe"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.json rg -n '"id": "URL-raIKe"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 373
🏁 Script executed:
#!/bin/bash file="src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json" echo "Checking Prompt node ID:" rg -n '"id": "Prompt-sBJbI"' -n "$file" echo -e "\nChecking edge target:" rg -n '"target": "Prompt-sBJbI"' -n "$file" echo -e "\nInspecting sourceHandle snippet:" rg -n '"sourceHandle":' -n "$file" -A2 echo -e "\nInspecting targetHandle snippet:" rg -n '"targetHandle":' -n "$file" -A2Length of output: 6217
Edge mappings for URL→Prompt verified and approved
All occurrences ofURL-raIKe
andPrompt-sBJbI
were found as node IDs, and both the object-style and serializedsourceHandle
/targetHandle
entries correctly reference those IDs. No discrepancies detected. LGTM.
156-176
:✅ Verification successful
Verify edge mappings for ChatInput → Prompt
The edge connectingChatInput-dl2NG
back to the prompt node has been updated. Confirm thatChatInput-dl2NG
is defined in nodes and thatPrompt-sBJbI
accepts"Message"
and"Text"
as inputs.
🏁 Script executed:
rg -n '"id": "ChatInput-dl2NG"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 242
I’ll pull the surrounding definitions for both nodes to confirm their mappings.
🏁 Script executed:
#!/bin/bash FILE="src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json" echo "— ChatInput-dl2NG node definition —" rg -n -B5 -A5 '"id": "ChatInput-dl2NG"' "$FILE" echo echo "— Prompt-sBJbI node definition —" rg -n -B5 -A5 '"id": "Prompt-sBJbI"' "$FILE"Length of output: 3947
Edge mapping ChatInput → Prompt confirmed
ChatInput-dl2NG
is defined as aChatInput
node emitting"Message"
, andPrompt-sBJbI
’s target handles (e.g.USER_INPUT
,CHAT_HISTORY
) accept both"Message"
and"Text"
. No changes required.
97-118
:✅ Verification successful
Verify edge mappings for Prompt → AnthropicModel
The edge fromPrompt-sBJbI
toAnthropicModel-BC7GB
has been remapped. Ensure thatAnthropicModel-BC7GB
exists in the nodes list and that required inputType"Message"
is valid for itsinput_value
field.
🏁 Script executed:
rg -n '"id": "AnthropicModel-BC7GB"' -n src/backend/base/langflow/initial_setup/starter_projects/Custom\ Component\ Maker.jsonLength of output: 308
🏁 Script executed:
#!/bin/bash # Show context around the AnthropicModel node definition to verify its fields and inputTypes rg -A8 -B8 '"id": "AnthropicModel-BC7GB"' -n 'src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json'Length of output: 2448
🏁 Script executed:
#!/bin/bash # Extract the AnthropicModel-BC7GB node definition to inspect its inputs sed -n '1410,1550p' 'src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json'Length of output: 4786
🏁 Script executed:
#!/bin/bash # Verify the definition of the `input_value` field in the template rg -A5 -B5 '"input_value": {' -n 'src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json'Length of output: 217
🏁 Script executed:
#!/bin/bash # Search for the definition of the `input_value` template field using fixed string matching rg -F -n '"input_value": {' 'src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json'Length of output: 224
🏁 Script executed:
#!/bin/bash # Display the template definition for `input_value` to verify supported input_types sed -n '1545,1585p' 'src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json'Length of output: 9270
Edge Mapping Confirmed for Prompt → AnthropicModel
- Node
AnthropicModel-BC7GB
is defined in the JSON.- Its
input_value
field declaresinput_types: ["Message"]
, matching the edge’s"Message"
type.No further action required.
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (18)
10-10
: Consistent ID update for ChatInput→OpenAIModel edge
The node and handle IDs for the ChatInput-to-OpenAIModel connection have been regenerated correctly and the edge reference is consistent. Verify there are no duplicate edge IDs across the graph.Also applies to: 18-18, 25-25, 27-30
38-38
: Updated Prompt→OpenAIModel edge identifiers
The unique IDs and handle descriptors for the Prompt-to-OpenAIModel connection have been refreshed and align with the new node IDs. Ensure the changes propagate correctly in frontend rendering.Also applies to: 46-46, 53-53, 55-59
67-67
: Refreshed OpenAIModel→ChatOutput edge IDs
Edge source and target IDs reflect the regenerated values and the handle encoding matches the updated types. Confirm no broken references in the runtime.Also applies to: 74-74, 83-83, 85-88
94-96
: Regenerated Memory→Prompt edge mapping
The Memory component output (messages_text
) now correctly connects to the Prompt input (memory
) with new unique node and edge IDs. Validate thatinputTypes
include the correct types (Message
andText
).Also applies to: 103-116
122-122
: ChatInput node data.id updated
NodeChatInput
has a newdata.id
value; ensure it matches the generated ID used in all related edges.
406-406
: ChatInput node instance id refreshed
Node instanceid
is consistent with itsdata.id
. Confirm no mismatches exist.
427-427
: ChatOutput node data.id updated
The ChatOutput node'sdata.id
has been regenerated; verify consistency with all incoming edges.
710-710
: ChatOutput node instance id aligned
Instanceid
matches thedata.id
value. Ensure it aligns across the graph.
729-729
: Note nodenote-vPnjW
ID updated
The standalone note node’s ID has been regenerated. There are no dependencies, so no further action is needed.
740-740
: Note node instance id updated
Instanceid
aligns with the data declaration.
764-764
: Note-TCLyL node data.id regenerated
ID update only affects display and has no external impact.
777-777
: Note-TCLyL instance id consistency
Instanceid
correctly reflects thedata.id
.
796-796
: Prompt nodedata.id
updated
Ensure the newdata.id
for the Prompt node matches all edge references.
933-933
: Prompt node instance id refresh
Instanceid
is consistent withdata.id
; verify against connected edges.
952-952
: OpenAIModel node ID regeneration
Both metadata and instanceid
values have been updated; confirm all edges reference the new identifiers.Also applies to: 1331-1331
1046-1046
: Default API key placeholder
Theapi_key
field default has been set to"OPENAI_API_KEY"
. Confirm this environment variable is documented for users and included in setup instructions.
1380-1388
: NewData
output for MemoryComponent
Themessages
output now returns aData
type viaretrieve_messages
. Ensure downstream components correctly consume this type.
1393-1402
: AddedMessage
outputmessages_text
Themessages_text
output invokesretrieve_messages_as_text
to return a formattedMessage
. Validate that thedata_to_text
template produces the expected formatting.src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (16)
10-30
: Auto-generated flow edge IDs updated correctly
The edge definitions have new unique IDs and handle paths reflecting the regenerated identifiers forPrompt → OpenAIModel
. This aligns with the project’s node/edge re-generation.
38-61
: Consistent edge updates for OpenAIModel → ChatOutput
All edges from both OpenAIModel instances to their ChatOutput nodes have refreshed IDs and handle metadata. These updates are expected when regenerating starter flow configurations.
68-90
: Edge mappings for second OpenAIModel → ChatOutput updated
The secondOpenAIModel-nm6TC
now connects toChatOutput-AuLqC
with new edge identifiers. This maintains consistency across duplicated model nodes.
98-119
: Edge for ChatInput → Prompt refreshed
TheChatInput-50eRP
toPrompt-o9CSB
edge has refreshed IDs and handles, as expected after flow re-generation.
127-147
: Edge for Prompt → OpenAIModel-nm6TC updated
Prompto9CSB
now links to OpenAIModelnm6TC
with new edge metadata. Regeneration is correct.
149-175
: AssemblyAI Job Creator → Poller edge refreshed
The flow edge betweenAssemblyAITranscriptionJobCreator-7GviL
andAssemblyAITranscriptionJobPoller-9pXw0
has updated IDs. This matches the other starter projects.
183-204
: Polling results → Parser edge regenerated
The edge from the poller to the parser node now has new unique identifiers. This is expected.
211-233
: Parser → Prompt (transcribed text) edge refreshed
The mapping fromparser-Qeh0K
toPrompt-pYU9n
is regenerated with new IDs, preserving the intended connection.
241-263
: Parser → ChatOutput-BBZ6j edge updated
Parser output now links toChatOutput-BBZ6j
with new edge metadata. Consistent with overall ID refresh.
265-292
: New Memory → Prompt edge formessages_text
You’ve added themessages_text
edge fromMemory-qCviX
toPrompt-o9CSB
, enabling the new text‐formatted history output. This aligns with the enhanced MemoryComponent.
2492-2514
: Expanded Memory outputs: Data, Message, DataFrame
The Memory node now declares three outputs (messages
,messages_text
,dataframe
) corresponding to raw data, formatted text, and DataFrame. This correctly mirrors the updated MemoryComponent API.
2549-2549
: Updated embedded MemoryComponent code
The"value"
field now contains the enhanced MemoryComponent class, includingretrieve_messages_as_text
and DataFrame conversion logic. This matches your backend helper implementation.
2756-2758
: Memory node ID and measurements refreshed
Memory-qCviX
has a new unique ID and updated measured dimensions, consistent with auto-regeneration of the flow.
346-347
: Standardized API key inputs to load from DB
Both the AssemblyAI Poller and Creator templates now setload_from_db: true
on theirapi_key
inputs and default to"ASSEMBLY_API_KEY"
. This standardizes the credential handling across starter projects.Also applies to: 355-356
535-535
: OpenAIModel API key default placeholder
The OpenAIModel templates now loadapi_key
from the DB with the default"OPENAI_API_KEY"
. This change is consistent across both model instances.
821-821
: OpenAIModel-Q72AI measured dimensions updated
OpenAIModel-Q72AI
has updated UI measurements after flow regeneration. This has no functional impact.
This pull request introduces enhancements to the
MemoryComponent
class and updates the starter project configuration for custom components. Key changes include adding new output methods for retrieving messages in different formats, modifying the structure of outputs in theMemoryComponent
, and updating node and edge configurations in the starter project JSON.Enhancements to
MemoryComponent
:retrieve_messages_as_text
to convert stored messages into text format using thedata_to_text
helper.outputs
list to includeData
,Message
, andDataFrame
formats, allowing more flexibility in retrieving and processing stored messages. [1] [2]Updates to starter project configuration:
Custom Component Maker.json
to ensure proper linkage and compatibility. [1] [2]Data
andMessage
types, aligning with the updatedMemoryComponent
outputs.Summary by CodeRabbit
New Features
Bug Fixes
Chores
Refactor
Tests