Skip to content

fix: Template updates to fix broken edges#8785

Merged
edwinjosechittilappilly merged 3 commits into
mainfrom
fix-templates-llm
Jun 30, 2025
Merged

fix: Template updates to fix broken edges#8785
edwinjosechittilappilly merged 3 commits into
mainfrom
fix-templates-llm

Conversation

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly commented Jun 30, 2025

Template Updates

Summary by CodeRabbit

  • New Features

    • Improved input fields for system messages and user prompts, including support for multiline input and enhanced message handling.
    • Default output selection for language model components is now set to text output.
  • Enhancements

    • Updated icons for provider dropdown options for clearer identification.
    • Adjusted component names and connections to better reflect chat-based workflows.
    • Improved UI metadata for language model components.
  • Style

    • Minor adjustments to node positions and viewport settings for better visual organization.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 30, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 30, 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

The updates modify the "Basic Prompt Chaining" and "Basic Prompting" starter project JSON configurations by regenerating node and edge IDs, updating node types and input field definitions, adjusting UI metadata, and aligning input/output types and icons for the LanguageModelComponent. No core logic changes were made to the underlying Python component.

Changes

File(s) Change Summary
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json Regenerated node and edge IDs, updated node types and dataType fields, changed input types for "system_message" and "input_value," set "selected_output" in LanguageModelComponent, updated provider icon, adjusted viewport and node positions.
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json Replaced "Prompt" nodes with "ChatInput," updated node/edge IDs, changed LanguageModelComponent input types, set "selected_output," updated provider icon, extended outputs metadata, removed "lf_version," adjusted viewport and node positions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ChatInput
    participant LanguageModelComponent
    participant ChatOutput

    User->>ChatInput: Submit input
    ChatInput->>LanguageModelComponent: Pass input_value/system_message
    LanguageModelComponent->>ChatOutput: Output (text_output/model_output)
    ChatOutput->>User: Display response
Loading

Possibly related PRs

Suggested labels

bug, size:S, lgtm

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch fix-templates-llm

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.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 30, 2025
Copy link
Copy Markdown
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: 0

🔭 Outside diff range comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (1)

785-807: ChatOutput.input_value switched to MessageInput but still accepts Data / DataFrame

MessageInput internally validates payloads as str|Message|list[Message]; passing a Data object will now raise TypeError.
If the node is meant to visualise arbitrary structured data, revert to HandleInput or provide a custom MessageInput subclass that widens the allowed types.

🧹 Nitpick comments (4)
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (2)

25-30: High-ASCII “œ” characters inside the auto-generated edge id

The new id strings (reactflow__edge-…) embed curly-brace payload re-encoded with the “œ” glyph.
Those non-ASCII bytes occasionally trip URL-encoding when the canvas is shared via query-string or stored in some SQL variants.

Consider URL-safe base64 or plain JSON stringify instead of the current replacement scheme.


1417-1430: copy_field is not a recognised MultilineInput attribute

"copy_field": false is introduced for system_message, but the MultilineInput spec (see langflow/io/fields.py) does not include this flag.
Unknown keys are silently dropped in the UI, so the new property adds noise without any effect.

Either remove the key or implement support on the front-end if clipboard cloning is required.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (2)

1188-1191: Global version bumped to 1.5.0 but node-level lf_version fields stay at 1.4.2

The project’s last_tested_version is now 1.5.0, yet every node template still advertises "lf_version": "1.4.2".
This mismatch can confuse automated migration scripts or UI upgrade prompts. Consider updating the per-node fields as part of the template regeneration.

- "lf_version": "1.4.2"
+ "lf_version": "1.5.0"

510-524: Node id still prefixed with “undefined-” – tidy up for clarity

The README note uses an id like undefined-qkI8p. While it works technically, it signals that the generator had no prefix.
Regenerating with a meaningful prefix (e.g., ReadMe-qkI8p) improves readability when debugging large flows.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ce568c and 4feca6f.

📒 Files selected for processing (2)
  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (42 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (19 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 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: Starter project files are auto-formatted after langflow run; these changes can be committed or ignored
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/initial_setup/starter_projects/Basic Prompt Chaining.json (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: Starter project files are auto-formatted after langflow run; these changes can be committed or ignored
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 Langflow's 'Message' objects and chat functionality by asserting correct properties and structure.
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: 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').
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (7)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-06-30T14:39:17.428Z
Learning: Starter project files are auto-formatted after langflow run; these changes can be committed or ignored
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/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.
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/testing.mdc:0-0
Timestamp: 2025-06-30T14:41:58.837Z
Learning: Applies to {src/backend/tests/**/*.py,tests/**/*.py} : Test Langflow's 'Message' objects and chat functionality by asserting correct properties and structure.
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: 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').
🔇 Additional comments (7)
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (5)

24-31: Edge handle “type” still declared as "str" while inputTypes = ["Message"]

Several newly-generated edge objects (see also lines 55-60, 83-88, 111-116, 139-144, 167-172, 195-200) keep the legacy "type": "str" flag although the corresponding port advertises Message semantics.
The front-end usually infers socket compatibility by comparing inputTypes / output_types; keeping "str" here can silently disable run-time validation and break drag-and-drop auto-filtering.

-            "type": "str"
+            "type": "Message"

Please run langflow validate --starter-project to ensure every source/target handle pair shares the exact same declared type.


1308-1329: Consistency check – upstream edges now deliver a Message, not raw str

Good catch replacing MessageTextInput with MessageInput; this aligns the LanguageModelComponent with the new chat-first API.


1384-1385: Icon enum updated to GoogleGenerativeAI – LGTM

The new value matches the rebranded icon set and will render correctly in both dark/light themes.


1680-1681: Duplicate provider icon update – no further action

Same remark as above; duplication across nodes is expected in starter projects.


2110-2112: Viewport zoom/offset tweaked – ignore

Pure layout change generated by auto-formatter—safe to commit.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (2)

25-30: Edge IDs use non-standard “œ” delimiters – verify they still round-trip

The edge id and handle strings now embed curly‐brace JSON fragments separated by œ.
If any consumer expects valid JSON or URI-encoded text, these characters may break parsing or URL generation.

- "id": "reactflow__edge-ChatInput-SzjnT{œdataType…
+ // e.g. encode as base64 or URI-safe string, or keep plain JSON without custom delimiters

Please confirm that the front-end and import/export paths still accept this format after the change.


1073-1075: New provider icon “GoogleGenerativeAI” – ensure front-end mapping exists

options_metadata.icon was updated from Google to GoogleGenerativeAI.
Double-check that the React icon map (usually src/frontend/icons.ts or similar) contains this key, or the dropdown may render a missing icon placeholder.

@mendonk
Copy link
Copy Markdown
Collaborator

mendonk commented Jun 30, 2025

Screenshot 2025-06-30 at 2 49 12 PM
Screenshot 2025-06-30 at 2 49 32 PM
Screenshot 2025-06-30 at 2 50 19 PM

Basic prompt and prompt chaining are fixed. SEO Keyword still needs the fix @edwinjosechittilappilly

@edwinjosechittilappilly
Copy link
Copy Markdown
Collaborator Author

Adding the SEO Keyword fixes!

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 30, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 30, 2025
@mendonk
Copy link
Copy Markdown
Collaborator

mendonk commented Jun 30, 2025

Screenshot 2025-06-30 at 3 29 22 PM LGTM

Copy link
Copy Markdown
Collaborator

@mendonk mendonk left a comment

Choose a reason for hiding this comment

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

+1

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 30, 2025
@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Jun 30, 2025
Merged via the queue into main with commit 748bb9d Jun 30, 2025
74 of 79 checks passed
@edwinjosechittilappilly edwinjosechittilappilly deleted the fix-templates-llm branch June 30, 2025 19:56
lucaseduoli pushed a commit that referenced this pull request Jul 1, 2025
* update llm component

* template updates

* Update SEO Keyword Generator.json
Khurdhula-Harshavardhan pushed a commit to JigsawStack/langflow that referenced this pull request Jul 1, 2025
* update llm component

* template updates

* Update SEO Keyword Generator.json
jordanrfrazier pushed a commit that referenced this pull request Jul 3, 2025
* update llm component

* template updates

* Update SEO Keyword Generator.json
@coderabbitai coderabbitai Bot mentioned this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants