feat: update structured output to multiline input and revise system prompt#8585
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 WalkthroughThe changes update the structured output component and its usage in several starter project configurations. The input field for unstructured text is switched from single-line to multiline, and the system prompt is rewritten to require extraction of only a single, well-formed JSON object from input text, with explicit instructions for handling duplicates and missing values. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant StructuredOutputComponent
participant LLM
User->>UI: Enter multiline unstructured text
UI->>StructuredOutputComponent: Pass input_value, system_prompt, schema, llm
StructuredOutputComponent->>LLM: Send system_prompt + input_value
LLM-->>StructuredOutputComponent: Return single JSON object (as per prompt)
StructuredOutputComponent->>UI: Output parsed structured object
UI->>User: Display structured output
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.
Actionable comments posted: 0
🔭 Outside diff range comments (3)
src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (1)
1014-1203: Critical: Front‐end node template is out of sync with the Python code block
The JSON “template” for the StructuredOutput node still declares:
input_valueas_input_type: "MessageTextInput"(should be"MultilineInput")system_prompt.valueretains the old instructions instead of the updated single‐object extraction promptThis mismatch will lead to user confusion and unexpected behavior in the Playground. Please update the front‐end template to mirror the Python defaults.
src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (2)
1423-1445: Inconsistentsystem_promptin UI configuration.The JSON default for
system_promptin this starter project still describes streaming multiple JSON objects. It should mirror the updated single-object extraction instructions:- "value": "You are an AI system designed to extract structured information from unstructured text.Given the input_text, return a JSON object with predefined keys based on the expected structure.Extract values accurately and format them according to the specified type (e.g., string, integer, float, date).If a value is missing or cannot be determined, return a default (e.g., null, 0, or 'N/A').If multiple instances of the expected structure exist within the input_text, stream each as a separate JSON object." + "value": "You are an AI that extracts one structured JSON object from unstructured text. Use a predefined schema with expected types (string, integer, float, date). If multiple structures exist, extract only the first most complete one. Fill missing or ambiguous values with defaults: null for missing values, 0 for numeric fields, and 'N/A' for strings. Ignore duplicates and partial repeats. Always return one valid JSON object, and nothing else."
1259-1265: UI input type forinput_valuenot updated.In the node’s UI configuration, the
input_valuefield is still defined asMessageTextInput. It should be switched toMultilineInputto match the component signature and allow multi-line financial reports.
🧹 Nitpick comments (4)
src/backend/base/langflow/components/processing/structured_output.py (1)
44-51: Whitespace missing between concatenated sentences in system promptBecause adjacent string literals are concatenated verbatim, the final two sentences run together (
"...multiple objects.Output: ...") due to the absence of a trailing space at the end of line 50 (or a leading space at line 51). This slightly degrades prompt clarity and could confuse the LLM.- "Always return one valid JSON—never throw errors or return multiple objects." - "Output: A single well-formed JSON object, and nothing else." + "Always return one valid JSON—never throw errors or return multiple objects. " + "Output: A single well-formed JSON object, and nothing else."src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (1)
910-982: Minor formatting insystem_promptdefault.The concatenated prompt string omits a space before
"Output:", causing the sentences to merge ("...objects.Output:"). Please insert a trailing space in the preceding sentence (or a leading space on"Output:") for proper separation.Suggested diff:
--- a/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Market Research.json @@ "value": ( - "Always return one valid JSON—never throw errors or return multiple objects." - "Output: A single well-formed JSON object, and nothing else." + "Always return one valid JSON—never throw errors or return multiple objects. " + "Output: A single well-formed JSON object, and nothing else." )src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (1)
995-1012: Nit: Tweak the system prompt string formatting and clean up imports
In the embedded Python code block, the adjacent string literals for the final sentences lack a separating space, which will concatenate into “…objects.Output:” at runtime. Also,MessageTextInputis imported but not used in this component.
Apply this diff:--- a/.../Image Sentiment Analysis.json +++ b/.../Image Sentiment Analysis.json @@ value=( - "Always return one valid JSON—never throw errors or return multiple objects." - "Output: A single well-formed JSON object, and nothing else." + "Always return one valid JSON—never throw errors or return multiple objects. " + "Output: A single well-formed JSON object, and nothing else." ) @@ from langflow.io import ( - HandleInput, - MessageTextInput, + HandleInput, MultilineInput, Output, TableInput, )src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (1)
1257-1294: Missing space before 'Output:' in system_prompt concatenation.In the
system_promptliteral, there is no space between the end of the sentence and"Output:", resulting in"objects.Output:". Please insert a space:- "...never throw errors or return multiple objects.""Output: A single..." + "...never throw errors or return multiple objects. Output: A single..."
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/backend/base/langflow/components/processing/structured_output.py(2 hunks)src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Market Research.json(1 hunks)src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/backend/base/langflow/components/processing/structured_output.py (1)
src/backend/base/langflow/inputs/inputs.py (1)
MultilineInput(259-269)
🔇 Additional comments (5)
src/backend/base/langflow/components/processing/structured_output.py (1)
32-38: MultilineInput switch looks goodReplacing
MessageTextInputwithMultilineInputforinput_valueis appropriate for longer user prompts and the import is already present. No additional changes required.src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json (1)
612-612: Approve: Embedded component code updated to enforce single-object extraction and multiline input.The
StructuredOutputComponentcode string now usesMultilineInputforinput_value(supporting multiline text) and the defaultsystem_promptunambiguously instructs extraction of exactly one JSON object with fallback defaults, ignoring duplicates and preventing multiple outputs. This aligns perfectly with the PR’s goal of enforcing a single well-formed JSON output.src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (1)
882-910: Approve input type change forinput_value.Switching the
input_valuefield from a single‐lineMessageTextInputto aMultilineInputaligns with the requirement to accept potentially long, unstructured text inputs. This update matches the core component and ensures consistency across starter projects.src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json (1)
1508-1512: Validatetemplate.codefield type
Switching the component’s template field to"type": "code"ensures the Python snippet is rendered with proper syntax highlighting and multiline support in the UI (aligned with"multiline": true).src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (1)
1241-1256: Align component inputs with multiline requirements.The
StructuredOutputComponentcode now correctly defines bothinput_valueandsystem_promptasMultilineInput, matching the intended design for handling multi-line unstructured text.
| "If multiple instances of the expected structure exist within the input_text, " | ||
| "stream each as a separate JSON object." | ||
| "You are an AI that extracts one structured JSON object from unstructured text. " | ||
| "Use a predefined schema with expected types (string, integer, float, date). " |
There was a problem hiding this comment.
remove date
| "Use a predefined schema with expected types (string, integer, float, date). " | ||
| "If multiple structures exist, extract only the first most complete one. " | ||
| "Fill missing or ambiguous values with defaults: null for missing values, " | ||
| "0 for numeric fields, and 'N/A' for strings. " |
There was a problem hiding this comment.
null for missing and ambigious values for all type.
…rompt (#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…rompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (langflow-ai#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (langflow-ai#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (langflow-ai#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (langflow-ai#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (langflow-ai#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…rompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update Vector Store RAG.json * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update templates * update templates * First round of template updates * Update templates * fix: Update SaaS, Social Media, and YouTube json file (langflow-ai#8441) * update SaaS, Social Media, and YouTube json file * fix: make starter projects auto refactor not remove selected output (langflow-ai#8400) * Fixed bug where starter projects were refactored incorrectly * fix: improve handling of selected outputs in custom component template builder - Added checks to ensure selected output is valid before attempting to set its state. - Enhanced code readability with comments explaining the logic for selecting outputs. * Set selected output as the previous selected output * Update base.py --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * fix: made clean edges clean after changing dropdown of output (langflow-ai#8460) fixed output considering all outputs not just selected one * refactor(docker): remove --extra deploy flag from uv sync commands (langflow-ai#8485) 🔧 (build_and_push_with_extras.Dockerfile): remove unnecessary uv sync command options to improve build efficiency and reduce redundancy Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: refactor mcp and freeze tests to be less prone to flaky results (langflow-ai#8486) * Fixed mcp test to be less prone to errors * Fix freeze spec * fix: made button disabled state more congruent, made edit flow details submit on enter (langflow-ai#8339) * Changed textarea classes * Changed flowsettingscomponent to use form * changed edit flow settings to use form and to submit on enter * Reset form data on close * Updated disabled state to have lower opacity instead of to have set background * Fixed loading state of button * Fix: chat memory store issue and fix output types (langflow-ai#8463) * fix chat memory * update template * update update outputs * update update outputs --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * ci: update setup-uv to possibly fix caching (langflow-ai#8490) * update json * fix custom component * revert change --------- Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> * fix: templates (langflow-ai#8499) * basic-prompting-template-updated * show-system-message * names * blog-writer-tested * financial-report-parser * image-sentiment-analysis * seo-keyword-generator * seo-keyword-generator * Merge branch 'fix-vector-search-template' into mendons-template-branch --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> * Update Basic Prompting.json * Update Blog Writer.json * Further template updates * Update Image Sentiment Analysis.json * Update templates * Update Financial Report Parser.json * Update Market Research.json * Update Market Research.json * update several templates * Update Image Sentiment Analysis.json * Update Market Research.json * Update image sentiment analysis template * Update Market Research.json * Update Custom Component Maker.json * Update Custom Component Maker.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * Update Hybrid Search RAG.json * More template updates * Update Financial Report Parser.json * updated templates * change custom component maker * Update Twitter Thread Generator.json * updates from main * change model * Update Research Translation Loop.json * expanded output component to fix tests * update template * autofix * fix error * fix change back * change back * ci: Skip truncated values test for refactoring (langflow-ai#8670) * refactor: simplify init target by removing cache cleanup and adding pre-commit hook (langflow-ai#8590) * build: add pyyaml dependency * refactor: simplify init command by removing cache cleaning and langflow run call * refactor: simplify init target by removing cache cleanup and adding pre-commit hook * refactor: update langchain_core.prompts import paths to use specific modules --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> * feat: update structured output to multiline input and revise system prompt (langflow-ai#8585) * Update structured_output.py * [autofix.ci] apply automated fixes * Update structured_output.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * update to prompt * template updates * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * Update src/backend/base/langflow/components/processing/structured_output.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: add sessions endpoint with session management enhancements (langflow-ai#8596) * 📝 (monitor.py): Add endpoint to get sessions and handle session_id encoding for API requests 📝 (use-get-messages-mutation.ts): Implement a mutation function to fetch messages with query parameters and handle session_id encoding for API requests 📝 (use-get-messages-polling.ts): Ensure proper encoding of session_id for API requests in polling mutation 📝 (use-get-messages.ts): Handle session_id encoding for API requests in messages query 📝 (new-modal.tsx): Implement functions to handle session deletion and proper encoding of session_id for API requests 📝 (utils.ts): Add functions to encode, decode, validate, format, and prepare session IDs for API requests * 📝 (constants.ts): Add SESSIONS constant to API URLs for monitoring sessions 🔧 (use-delete-messages.ts): Add queryClient to UseRequestProcessor to invalidate sessions query ✨ (use-get-sessions-from-flow.ts): Introduce useGetSessionsFromFlowQuery to fetch sessions from flow 🔧 (use-rename-session.ts): Change refetchQueries to invalidateQueries for useGetSessionsFromFlowQuery 🔧 (custom-new-modal.tsx): Update import path for IOModal to playground-modal 🔧 (session-selector.tsx): Add setActiveSession function to handle setting active session 🔧 (sidebar-open-view.tsx): Add setActiveSession function to handle setting active session ♻️ (new-modal.tsx): Refactor IOModal into playground-modal and update functionality ♻️ (playground-modal.tsx): Refactor IOModal to handle playground-specific functionality ⬆️ (flowStore.ts): Add newChatOnPlayground state and setNewChatOnPlayground function ⬆️ (index.ts): Update FlowStoreType to include newChatOnPlayground and setNewChatOnPlayground * 🔧 (pyproject.toml): update testpaths to point to the correct directory for tests ✨ (test_session_endpoint.py): add unit tests for sessions endpoint with flow_id filtering ♻️ (session-selector.tsx): refactor to trim editedSession before setting it ♻️ (sidebar-open-view.tsx): refactor to set visibleSession instead of activeSession * ✨ (use-get-sessions-from-flow.ts): Always include the flow ID as the default session if it's not already present ♻️ (playground-modal.tsx): Refactor setting sessions to include currentFlowId as the default session if not present, and handle visibility of sessions more efficiently * ♻️ (use-get-messages-mutation.ts): remove unused imports and refactor code for better readability and maintainability * ✨ (test_session_endpoint.py): refactor test function names for better clarity and consistency * ✨ (create-new-session-name.ts): add function to generate a new session name based on the current date and time 🔧 (playground-modal.tsx): import createNewSessionName function to dynamically set a new session name when no session is visible * [autofix.ci] apply automated fixes * ✨ (monitor.py): rename get_sessions endpoint to get_message_sessions for clarity and consistency 🔧 (constants.ts): remove unused SESSIONS constant from API URLs 🔧 (use-delete-messages.ts): remove commented out code and unnecessary comments ✨ (use-delete-sessions.ts): add functionality to delete sessions in frontend 🔧 (use-get-sessions-from-flow.ts): update API endpoint for getting sessions to match backend changes 🔧 (playground-modal.tsx): add functionality to delete sessions and associated messages in the UI, update UI optimistically, and handle errors appropriately * [autofix.ci] apply automated fixes * 🐛 (monitor.py): Fix type hinting issue in delete_messages function 📝 (monitor.py): Add comments and improve readability in test_messages_endpoints.py 📝 (session_endpoint.py): Update endpoint paths for consistency and clarity in test_session_endpoint.py * [autofix.ci] apply automated fixes * fix: update SQL statement to use col() for session_id filtering in get_message_sessions function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * fix: implemented cached values and temporary MCP servers on MCP component (langflow-ai#8628) * Added actionCount to fetch only servers without actionCount * Updated queries and uses to use servers without action data first, and then to fetch them * removed comment * updated constants * Added loading dropdown * Make options persist * Implemented new value format for McpComponent and implemented saving and removing temp Mcp Server if config is existent * Changed value type * Implemented cache and saving the server config * Fixed mcp server test * fix backend formatting * fixed lint * Added await * Fixed save button not appearing when no servers are available * added condition to only show save button when options is not null * template autofix * change template * update text sentiment analysis * change basic prompt back * change image sentiment back * update text sentiment and twitter * Update Twitter Thread Generator.json * Add back the input for the chat * add change * fix text sentiment * update research translation * Update Research Translation Loop.json --------- Co-authored-by: Eric Hare <ericrhare@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Style