Commit graph

456 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
c1d417adf2
fix: Improve duplicate flow name handling and add comprehensive tests (#8962)
*  (flows.py): Improve flow naming logic to handle duplicate names more effectively and accurately
📝 (test_rename_flow_to_save.py): Add unit tests to ensure correct numbering and handling of duplicate flow names

* [autofix.ci] apply automated fixes

*  (test_rename_flow_to_save.py): refactor test functions to remove unnecessary session parameter and improve code readability

* 📝 (flows.py): improve regex pattern to extract numbers only from flows following a specific naming convention to avoid extracting numbers from the original flow name if it contains parentheses

* [autofix.ci] apply automated fixes

* 📝 (flows.py): improve comments for better readability and understanding of regex usage in extracting numbers from flow names

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:45:15 +00:00
Rodrigo Nader
3bb22b29cc
feat: Add dual output support to Agent component with structured JSON parsing (#8836)
* feat: Add dual output support to Agent component with structured JSON parsing

## Summary
- Add "Structured Response" output alongside existing "Response" output
- Filter out conflicting json_mode field from OpenAI inputs
- Implement robust JSON parsing with fallback handling

## Changes Made
### Agent Component (agent.py)
- Add second output: "Structured Response" (Data type) with tool_mode=False
- Filter json_mode from OpenAI inputs to prevent UI conflicts
- Add json_response() method with multi-stage JSON parsing:
  - Direct JSON parsing for valid responses
  - Regex extraction for embedded JSON in text
  - Graceful error handling with diagnostic info
- Share execution between outputs (no duplicate agent runs)
- Fix model building to handle missing json_mode attribute

### Tests (test_agent_component.py)
- Add 9 comprehensive test cases covering:
  - Dual output structure validation
  - Input filtering verification
  - JSON parsing (valid, embedded, error cases)
  - Model building without json_mode
  - Shared execution efficiency
  - Frontend node structure
  - Component initialization

## Benefits
- Users get both Message and Data output types to choose from
- Clean UI without confusing duplicate JSON toggles
- Robust JSON parsing handles various response formats
- Efficient single-execution approach
- Maintains backward compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* update to templates with  model list update

* [autofix.ci] apply automated fixes

* Update test_agent_component.py

* update to the test and update to templates

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-07-21 16:33:30 +00:00
Gabriel Luiz Freitas Almeida
ca595ac7fb
feat: add module and code hash to component's metadata (#8737)
* feat: filter out base components path in custom component loading

* revert changes to allow testing the function

* feat: add module_name parameter to custom component template functions

* feat: include full module name in component template creation

* feat: add module metadata to various starter project JSON files

* feat: add code hash generation for custom component templates

* test: add unit tests for code hash and module metadata functionality

* feat: add code hash to metadata in various starter project JSON files

* feat: refactor code hash generation to accept source code and class name

* feat: implement loading strategy for custom components in settings service

* Update metadata for various starter project JSON files to include code hashes and module references for ChatInput and ChatOutput components. This enhances traceability and consistency across the project configurations.

* refactor: improve _generate_code_hash function for better error handling and clarity

- Simplified the logic to generate a SHA256 hash of the source code.
- Added explicit error handling for empty source code, encoding issues, and type errors.
- Updated docstring to reflect changes in argument descriptions and added information about raised exceptions.

* test: add unit tests for metadata functionality in custom utils

- Introduced tests for the _generate_code_hash function, covering basic hash generation, error handling for empty and None source, hash consistency, and uniqueness for different code.
- Added tests to verify metadata addition in template building functions, ensuring that module names and code hashes are correctly included in the metadata of custom components.

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-07-18 18:03:17 +00:00
Gabriel Luiz Freitas Almeida
f1e95940a5
feat(database): add noop mode with config flag and update related tests (#9054)
* test: enhance agent component tests and add new fixture for database-less sessions

- Added `use_noop_session` fixture to facilitate testing without a database.
- Expanded `TestAgentComponent` with new tests for agent responses using the Calculator tool and validation across all OpenAI and Anthropic models.
- Updated `test_component.py` to include tests for message sending without a database, ensuring proper event handling and message integrity.
- Refactored existing tests for clarity and consistency.

* fix: enhance user retrieval logic in get_or_create_super_user and teardown_superuser functions

- Updated user retrieval in both functions to handle different result types from the database query, ensuring robustness against unexpected return values.
- Added checks for `first()` method and list type to improve error handling and maintainability.

* feat: add support for no-op database operations in settings

- Introduced `use_noop_database` configuration option to disable all database operations, controlled by the `LANGFLOW_USE_NOOP_DATABASE` environment variable.
- Updated the `use_noop_session` fixture to reflect the new environment variable for testing without a database.

* feat: implement NoopSession for database-less operations

- Added NoopSession class to provide a no-operation database session, allowing for testing and operation without a real database connection.
- Updated DatabaseService to utilize NoopSession when the `use_noop_database` setting is enabled, ensuring all database operations are disabled in this mode.
- Enhanced error handling and logging for session management, improving robustness in scenarios where the database is not in use.

* refactor: update import paths for NoopSession in test files

- Changed import path for NoopSession from `langflow.services.database.service` to `langflow.services.database.session` in both `test_agent_component.py` and `test_component.py`.
- This refactor improves code organization and aligns with recent changes in the project structure.

* feat: enhance NoopSession with result handling methods

- Added an internal _NoopResult class to the NoopSession, providing methods `first()`, `all()`, and `one_or_none()` for better handling of no-operation results.
- This enhancement improves the usability of NoopSession in testing scenarios by mimicking expected database query behaviors.

* refactor: improve logging for NOOP database session

- Changed the log level from warning to info for the NOOP database session message in the DatabaseService class.
- This adjustment enhances clarity in logging, indicating that all DB operations are disabled without implying an error condition.

* docs: improve docstring formatting for custom_component_update function

- Reformatted the docstring for the custom_component_update function to enhance readability by breaking long lines into multiple lines.
- This change improves documentation clarity, making it easier for developers to understand the function's purpose and behavior.

* docs: add LANGFLOW_USE_NOOP_DATABASE environment variable documentation

- Introduced documentation for the new LANGFLOW_USE_NOOP_DATABASE environment variable, which allows users to enable a no-op database mode, avoiding database connections and operations.
- This addition enhances the clarity of configuration options available for Langflow, aiding users in understanding how to run flows without a database.

* refactor: move NOOP database session logging to settings

- Removed the logging statement from the DatabaseService class and added it to the `set_use_noop_database` field validator in the Settings class.
- This change centralizes the logging for the NOOP database session, improving code organization and ensuring that the message is logged whenever the setting is applied.
2025-07-15 16:52:23 +00:00
Lucas Oliveira
2fec8437b8
fix: make files be saved in unique path (#8965)
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-07-10 08:42:03 -03:00
Rodrigo Nader
a0e484c0eb
feat: add DataFrame output to Structured Output component (#8842)
* feat: add DataFrame output to Structured Output component

- Add new DataFrame output alongside existing Data output for structured data
- Single output: creates DataFrame with one row
- Multiple outputs: creates DataFrame with multiple rows, each containing a Data object
- Maintains backward compatibility with existing Data output
- Includes comprehensive test coverage for both single and multiple output scenarios

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes

* Update structured_output.py

* [autofix.ci] apply automated fixes

* udpate to tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* update to format instructions

* Update system prompt in structured output component test

Expanded the system prompt in the test for StructuredOutputComponent to provide more detailed extraction instructions, including handling of missing values, duplicates, and output format requirements. This improves test clarity and better simulates real-world extraction scenarios.

* [autofix.ci] apply automated fixes

* Update structured_output.py

* fix: return empty Data object instead of None in StructuredOutputComponent

Updated the return statement in the StructuredOutputComponent to return an empty Data object when there are no outputs, improving consistency in the output handling.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-07-09 21:57:07 +00:00
Rodrigo Nader
e0400f29eb
feat: enhance DataFrame Operations component with contains filter and modern UI (#8838)
* feat: enhance DataFrame Operations component with contains filter and modern UI

- Add "contains" filter operator for partial string matching in DataFrame filters
- Update UI to use SortableListInput with icons for consistent modern design
- Add 7 filter operators: equals, not equals, contains, starts with, ends with, greater than, less than
- Fix deselection handling to prevent "unhashable type: list" errors
- Improve dynamic field visibility when operations are deselected
- Add comprehensive test suite with 25 tests covering all operations and edge cases
- Update placeholder text from "Select DataFrame Operation" to "Select Operation"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* Update dataframe_operations.py

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-07-09 21:50:59 +00:00
Gabriel Luiz Freitas Almeida
d437d018ce
refactor(auth): simplify flow retrieval by removing settings_service dependency (#8956)
* refactor: Simplify flow reading logic by removing unnecessary settings service dependency

* 🛠️ (flows.py): Remove settings_service parameter from _read_flow and related functions to streamline flow retrieval logic.
* 🔧 (flows.py): Adjust query to directly filter by user_id, enhancing clarity and reducing complexity.

* test: Enhance flow retrieval tests with user isolation checks

* 🧪 (test_flows.py): Remove hardcoded user_id from flow creation tests to ensure user-specific data handling.
*  (test_flows.py): Add a new test to verify that users can only access their own flows, ensuring proper user isolation in flow retrieval.
* 🔧 (test_flows.py): Implement user creation and cleanup logic to maintain test integrity and avoid side effects.
2025-07-09 17:53:34 +00:00
Lucas Oliveira
1362aa1172
fix: make deletion of single file commit to DB, create tests for file deletion (#8953)
* Added commit to db session

* Changed order

* Deleted flush

* Added test to files
2025-07-09 15:17:54 +00:00
Gabriel Luiz Freitas Almeida
24db0cdc73 fix: remove crewai dependency and add import guards in crewai components (#8923) 2025-07-08 09:59:46 -03:00
Jordan Frazier
be18f6d03a feat: add new openai reasoning models (#8786)
* Add new openai reasoning models

* [autofix.ci] apply automated fixes

* Updates language model, but FE doesn't send a POST for updating template atm

* use chatopenai constants

* [autofix.ci] apply automated fixes

* Add reasoning to language model test

* Remove temp from all reasoning models

* t [autofix.ci] apply automated fixes

* refactor: Update template notes (#8816)

* update templates

* small-changes

* template cleanup

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* ruff

* uv lock

* starter projects update

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-07-08 09:59:46 -03:00
Jordan Frazier
15f2177c90 fix: handle EventLoopBlockError in CI to fix non-deterministic test failures (#8890)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
fix: fixes auth check for auto_login  (#8796)
2025-07-08 09:59:46 -03:00
Gabriel Luiz Freitas Almeida
7aeb687533
fix: don't send duplicate messages to Agent (#8909)
* fix: update message input handling in LCAgentComponent and improve memory data retrieval

* Refactor MessageTextInput to MessageInput for consistency.
* Enhance input dictionary construction to handle different input types in LCAgentComponent.
* Update get_memory_data method to filter out current input value from retrieved messages.

* fix: update AgentComponent to include documentation link and improve input handling

* Added documentation link for AgentComponent.
* Removed memory inputs from the agent component for cleaner input management.
* Enhanced error handling in message_response method to ensure better validation and logging of exceptions.

* fix: enhance input handling in LCAgentComponent by updating message conversion

* Updated input dictionary construction in LCAgentComponent to use to_lc_message() for Message instances, improving input handling consistency.

* test: add regression test for message duplication in agent component

* Introduced a new test to verify that mathematical expressions do not experience message duplication when processed by the agent component.
* The test checks both input and output JSON to ensure correct handling of expressions like "2+2" without duplication errors.

* test: add workspace tag to regression test for message duplication in agent component

* Updated the regression test for mathematical expressions to include the "@workspace" tag, enhancing test categorization and organization.
* This change ensures better tracking and management of tests related to the agent component.

* fix: add temporary comment in get_memory_data to address message duplication

* Added a TODO comment in the get_memory_data method of AgentComponent to indicate a temporary fix for message duplication issues. This serves as a reminder to develop a more robust solution in the future.

* feat: add message extraction utility for BaseMessage

* Introduced a new helper function, _get_message_from_base_message, to extract and concatenate text content from BaseMessage instances, improving message handling.
* Updated input handling in handle_on_chain_start to utilize the new extraction function, ensuring consistent processing of input messages.

* refactor: standardize code snippets across starter project JSON files

* Updated the "value" field in multiple starter project JSON files to ensure consistent formatting and structure of code snippets.
* This change enhances readability and maintainability of the code examples provided in the starter projects.

* feat: add caching and content dictionary creation for images

* Introduced a new function, create_image_content_dict, to generate a content dictionary for multimodal inputs from image files, enhancing image handling capabilities.
* Implemented LRU caching to optimize performance for repeated image processing.
* Added comprehensive error handling and documentation for better usability and maintainability.

* refactor: update message handling to utilize create_image_content_dict

* Replaced direct image URL creation with create_image_content_dict for improved image content handling in the Data and Message classes.
* Adjusted the order of content in human messages to ensure text appears first, enhancing message structure and clarity.
* Removed deprecated to_lc_message method to streamline the codebase and improve maintainability.

* docs: enhance _get_message_from_base_message docstring for clarity

* Expanded the docstring for the _get_message_from_base_message function to provide detailed information on input types, expected behavior, and examples of usage.
* Improved documentation aims to enhance usability and maintainability of the code by clarifying how to extract text content from BaseMessage instances.

* refactor: enhance image path handling and update message content structure

* Modified the get_file_paths function to support both Image objects and string paths for improved flexibility in file handling.
* Updated test cases to reflect changes in image content structure, ensuring consistency in type and source type attributes.
* Introduced new tests for create_image_content_dict to validate successful creation and error handling for image content dictionaries.

* refactor: streamline message extraction in handle_on_chain_start

* Removed the _get_message_from_base_message function to simplify the codebase.
* Updated handle_on_chain_start to directly use the text method of BaseMessage for extracting message content, enhancing clarity and maintainability.

* feat: enhance input handling for multimodal messages

* Added functionality to process image content within input messages, ensuring images are included in chat history as HumanMessage instances.
* Updated input handling logic to separate image types from text, improving the structure and clarity of message content.
* This enhancement supports better management of multimodal inputs in the agent's chat history.

* feat: add to_lc_message method for converting Data to BaseMessage

* Introduced the to_lc_message method in the Message class to facilitate conversion of Data instances to BaseMessage.
* Implemented logic to handle both HumanMessage and AIMessage based on the presence of required keys and sender type.
* Added logging for missing required keys to improve debugging and maintainability.

* refactor: simplify sender check in Message class

* Updated the sender validation logic in the Message class to remove unnecessary checks for missing sender values.
* This change enhances code clarity and maintains the intended functionality for handling user messages with associated files.

* test: update test_message_from_human_text to reflect content type change

* Modified the test for message conversion to assert that lc_message.content is a string instead of a list.
* Updated assertions to ensure the content matches the expected text, enhancing test accuracy and reliability.

* fix: update sender validation in Message class and adjust test case

* Modified the sender validation logic to handle cases where the sender is not specified, defaulting to HumanMessage.
* Updated the corresponding test case to reflect this change, ensuring accurate type assertion for lc_message when no sender is provided.

* refactor: update import statements for consistency and clarity

* Replaced the import of BaseModel from langchain.pydantic_v1 with the direct import from pydantic to streamline dependencies.
* This change enhances code clarity and aligns with best practices for managing imports in the codebase.

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
2025-07-08 01:36:39 +00:00
Gabriel Luiz Freitas Almeida
7ec3cb063d
chore(deps): update pyleak version and activate pyleak_marker in tests (#8905)
* chore: update pyleak dependency to version 0.1.14 in pyproject.toml and uv.lock

* fix(tests): enable pyleak marker in test files to address memory leak issues
2025-07-07 15:23:25 +00:00
Jordan Frazier
64855b2f49
fix: langwatch component initialization and some QoL (#8885)
* Fix langwatch component initialization and some QoL

* [autofix.ci] apply automated fixes

* Fix ruff and add unit tests

* [autofix.ci] apply automated fixes

* feat(langwatch): add utility for caching evaluators and refactor component to use it

* test(langwatch): add initial test file for LangWatchComponent and mock evaluator method

* fix(langwatch): use getattr for safer access to current_evaluator attribute

* test(langwatch): update cache clearing method to use utility 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>
2025-07-07 13:42:33 +00:00
Edwin Jose
a88829a9d6
feat(api): add special handling for _mcp_servers file uploads and improve tests (#8847)
* update

* [autofix.ci] apply automated fixes

* refactor: update file query logic and enhance error logging in file deletion

* refactor: enhance error handling and improve code clarity in MCP server list retrieval

* refactor: improve type hinting and code clarity in MCP servers file tests

* fix: handle potential None value for server configuration file in async server list retrieval

* Update test_files.py

* fix: autofix.ci / Update Starter Projects (pull_request)

* chore: Add API key environment variables to CI workflows

* Updated .github/workflows/ci.yml and .github/workflows/python_test.yml to include OPENAI_API_KEY, ANTHROPIC_API_KEY, and other relevant API keys as environment variables for CI jobs.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2025-07-04 16:20:04 +00:00
Gabriel Luiz Freitas Almeida
6403a8f564
fix(graph): fixes bug that caused simple flows with Loop to fail (#8809)
* fix: improve predecessors check for loop component

- Enhanced the handling of cycle vertices to prevent infinite loops by ensuring that a vertex can only run if all pending predecessors have completed.
- Updated conditions for the first execution of cycle vertices to allow running only if all pending predecessors are also cycle vertices.
- This refactor improves the robustness of the vertex management system in asynchronous workflows.

* fix: update _mark_branch method to return visited vertices and refine predecessor mapping

* fix: prevent duplicate item dependencies in LoopComponent

* feat: add loop connection handling in Component class

- Introduced methods to process loop feedback connections, allowing components to connect outputs to loop-enabled inputs.
- Implemented checks to validate loop connections and ensure proper handling of callable methods from other components.
- Enhanced the edge creation logic to support special loop feedback edges targeting outputs instead of inputs.

* fix: enhance name overlap validation in FrontendNode

- Updated the validate_name_overlap method to exclude outputs that allow loops from the overlap check.
- Improved error message to include the display name of the component, along with detailed lists of input and output names for better debugging.

* fix: correct condition for executing cycle vertices in RunnableVerticesManager

- Updated the logic to ensure that a cycle vertex can only execute if it is a loop and all pending predecessors are cycle vertices. This change enhances the robustness of the vertex management system in asynchronous workflows.

* feat: implement comprehensive loop flow for URL processing

- Added a new loop flow that processes multiple URLs through a series of components including URLComponent, SplitTextComponent, LoopComponent, ParserComponent, PromptComponent, OpenAIModelComponent, StructuredOutputComponent, and ChatOutput.
- Enhanced the StructuredOutputComponent to include a detailed system prompt and refined output schema to ensure proper JSON formatting.
- Introduced a test case to validate the creation and execution of the loop flow, ensuring all components are correctly integrated and the expected execution order is maintained.

* refactor: enhance loop target handling in Component and Edge classes

- Introduced LoopTargetHandleDict to better manage loop target structures in the Component and Edge classes.
- Updated the Component class to utilize type casting for loop target handles, improving type safety.
- Refactored the Edge class to accommodate the new loop target handling, ensuring compatibility with existing edge structures.
- Removed deprecated message handling methods from the Component class to streamline the codebase and improve maintainability.

* test: skip OpenAI model integration test if API key is not set

- Added a conditional skip to the test_build_model_integration_reasoning method to prevent execution when the OPENAI_API_KEY environment variable is not set, ensuring tests run only in appropriate environments.

* [autofix.ci] apply automated fixes

* chore: add required secrets for OpenAI and Anthropic APIs in CI workflows

* Updated ci.yml to include OPENAI_API_KEY and ANTHROPIC_API_KEY secrets.
* Modified python_test.yml to mark these secrets as required for workflow execution.

* fix: update OPENAI_API_KEY check in test_loop.py to handle dummy values

* Modified the condition in the pytest skipif decorator to also skip tests when OPENAI_API_KEY is set to "dummy", ensuring more robust test execution.

* refactor: streamline component setup in test_loop.py

* Removed redundant comments and improved formatting for component initialization in the loop_flow function.
* Added missing system_prompt to StructuredOutputComponent to resolve "Multiple structured outputs" error.
* Updated test_loop_flow to ensure it tests the graph creation with proper loop feedback connection.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-03 14:39:09 +00:00
Yuqi Tang
19c9514d54
feat: update if-else component (#8756)
* add ifelse component

* [autofix.ci] apply automated fixes

* fix test

* fix test

* fix test

* fix tests

* [autofix.ci] apply automated fixes

* fix tests

* fix test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Democh <democh@datax.dev>
2025-07-02 22:56:57 +00:00
Edwin Jose
e28093234b
ref: sidebar experience improvement with new bundles (#8824)
* cohere sidebar

* side bar embeddings

* move memories

* sort style utils

* [autofix.ci] apply automated fixes

* serach components add

* Update __init__.py

* Update styleUtils.ts

* [autofix.ci] apply automated fixes

* Update model_input_constants.py

* fix lint

* update to wikipedia

*  (tableInputComponent.spec.ts): Refactor test to use for loops for better readability and efficiency
 (filterEdge-shard-1.spec.ts): Update model names for better clarity and consistency
🐛 (duckduckgo.spec.ts): Update selector for search button to match changes in the frontend
🐛 (generalBugs-shard-11.spec.ts): Update selector for search button to match changes in the frontend

* [autofix.ci] apply automated fixes

* update tests path

* update tests

* Update test_arxiv_component.py

* [autofix.ci] apply automated fixes

* make embeddings functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-07-02 20:11:59 +00:00
Gabriel Luiz Freitas Almeida
1930fe0356
fix: comment out pyleak_marker in tests due to ongoing issues (#8826) 2025-07-02 09:01:31 -03:00
Deepankar Mahapatro
5734735e2d
test: add pyleak for task and event loop block detections (#8802)
* test: add pyleak for task and event loop block detections

* test: add pyleak for task and event loop block detections

* ci: add env variables for verbose logging

* chore: dummy sleep to shwocase error

* chore: dummy sleep to showcase error

* chore: remove dummy sleep
2025-07-01 13:07:25 +00:00
Edwin Jose
5ba8f91c9a
refactor: reorganize components and update PromptComponent with priority attribute (#8667)
* Update styleUtils.ts

* update to prompt component

* update to template

* update to mcp component

* update to smart function

* [autofix.ci] apply automated fixes

* update to templates

* fix sidebar

* change name

* update import

* update import

* update import

* [autofix.ci] apply automated fixes

* fix import

* fix ollama

* fix ruff

* refactor(agent): standardize memory handling and update chat history logic (#8715)

* update chat history

* update to agents

* Update Simple Agent.json

* update to templates

* ruff errors

* Update agent.py

* Update test_agent_component.py

* [autofix.ci] apply automated fixes

* update templates

* test fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>

* fix prompt change

* feat(message): support sequencing of multiple streamable models (#8434)

* feat: update OpenAI model parameters handling for reasoning models

* feat: extend input_value type in LCModelComponent to support AsyncIterator and Iterator

* refactor: remove assert_streaming_sequence method and related checks from Graph class

* feat: add consume_iterator method to Message class for handling iterators

* test: add unit tests for OpenAIModelComponent functionality and integration

* feat: update OpenAIModelComponent to include temperature and seed parameters in build_model method

* feat: rename consume_iterator method to consume_iterator_in_text and update its implementation for handling text

* feat: add is_connected_to_chat_output method to Component class for improved message handling

* feat: refactor LCModelComponent methods to support asynchronous message handling and improve chat output integration

* refactor: remove consume_iterator_in_text method from Message class and clean up LCModelComponent input handling

* fix: update import paths for input components in multiple starter project JSON files

* fix: enhance error message formatting in ErrorMessage class to handle additional exception attributes

* refactor: remove validate_stream calls from generate_flow_events and Graph class to streamline flow processing

* fix: handle asyncio.CancelledError in aadd_messagetables to ensure proper session rollback and retry logic

* refactor: streamline message handling in LCModelComponent by replacing async invocation with synchronous calls and updating message text handling

* refactor: enhance message handling in LCModelComponent by introducing lf_message for improved return value management and updating properties for consistency

* feat: add _build_source method to Component class for enhanced source handling and flexibility in source object management

* feat: enhance LCModelComponent by adding _handle_stream method for improved streaming response handling and refactoring chat output integration

* feat: update MemoryComponent to enhance message retrieval and storage functionality, including new sender type handling and output options for text and dataframe formats

* test: refactor LanguageModelComponent tests to use ComponentTestBaseWithoutClient and add tests for Google model creation and error handling

* test: add fixtures for API keys and implement live API tests for OpenAI, Anthropic, and Google models

* fix: reorder JSON properties for consistency in starter projects

* Updated JSON files for various starter projects to ensure consistent ordering of properties, specifically moving "type" to follow "selected_output" for better readability and maintainability.
* Affected files: Basic Prompt Chaining.json, Blog Writer.json, Financial Report Parser.json, Hybrid Search RAG.json, SEO Keyword Generator.json.

* refactor: simplify input_value type in LCModelComponent

* Updated the input_value parameter in LCModelComponent to remove AsyncIterator and Iterator types, streamlining the input options to only str and Message for improved clarity and maintainability.
* This change enhances the documentation and understanding of the expected input types for the component.

* fix: clarify comment for handling source in Component class

* refactor: remove unnecessary mocking in OpenAI model integration tests

* auto update

* update

* [autofix.ci] apply automated fixes

* fix openai import

* revert template changes

* test fixes

* update templates

* [autofix.ci] apply automated fixes

* fix tests

* fix order

* fix prompts import

* fix frontend tests

* fix frontend

* [autofix.ci] apply automated fixes

* add charmander

* [autofix.ci] apply automated fixes

* fix prompt frontend

* fix frontend

* test fix

* [autofix.ci] apply automated fixes

* change pokedex

* remove pokedex extra

* update template

* name fix

* update template

* mcp test fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-06-27 17:02:06 +00:00
Eric Hare
e1624b8c6e
feat: Better multi-file consistency for File Component (#8625)
* feat: First pass at output changes for file component

* SQLite support and json parsing

* [autofix.ci] apply automated fixes

* Update base_file.py

* [autofix.ci] apply automated fixes

* Update file.py

* [autofix.ci] apply automated fixes

* Split text supporting messages

* [autofix.ci] apply automated fixes

* Support structured json data

* Routine for inclusion of sample data

* Couple more template updates

* [autofix.ci] apply automated fixes

* Update Text Sentiment Analysis.json

* Update Portfolio Website Code Generator.json

* Test coverage

* [autofix.ci] apply automated fixes

* Update constants.py

* Update base_file.py

* Update service.py

* Update src/backend/base/langflow/components/processing/split_text.py

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* [autofix.ci] apply automated fixes

* Update service.py

* Add get file size that is unimplemented

* Update service.py

* Fix return

* Remove type annotation

* Update graph for new templates

* Update test_vector_store_rag.py

* Update stop-building.spec.ts

* [autofix.ci] apply automated fixes

* Update fileUploadComponent.spec.ts

* Update fileUploadComponent.spec.ts

* Update fileUploadComponent.spec.ts

* Update fileUploadComponent.spec.ts

* Update fileUploadComponent.spec.ts

* Update fileUploadComponent.spec.ts

* [autofix.ci] apply automated fixes

* Update fileUploadComponent.spec.ts

* test update

* Update fileUploadComponent.spec.ts

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
2025-06-26 21:12:34 +00:00
Edwin Jose
3b7b701813
test(cli): refactor test_components_path to use async thread and free port (#8748)
* Refactor test_components_path to run server in thread

The test now starts the CLI server in a separate thread on a free port, allowing asynchronous startup and avoiding port conflicts. This change improves test reliability and better simulates real server behavior.

* Update src/backend/tests/unit/test_cli.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve error handling in run_flow CLI test helper

The run_flow function now raises a RuntimeError with a detailed message if the CLI invocation fails, making test failures easier to diagnose.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-26 19:04:27 +00:00
coderabbitai[bot]
ba192428f9
tests: add tests for non-ASCII characters in flow name (#8532)
* CodeRabbit Generated Unit Tests: Update unit tests in test_projects.py

* [autofix.ci] apply automated fixes

* 📝 CodeRabbit Chat: Add unit tests for projects API in test_projects.py

* [autofix.ci] apply automated fixes

* refactor(tests): streamline project tests and enhance Cyrillic character handling

- Removed redundant test cases for unauthorized project creation and duplicate project names.
- Consolidated Cyrillic character tests for clarity and improved documentation.
- Added constants for Cyrillic project name and description to enhance readability.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-06-26 15:31:35 +00:00
Bar Nuri
fe7b7dfd27
feat: flow_runner better init and remove the depend on old load func (#7933)
* fixes

* fix: Update SQLAlchemy import to SQLModel in flow_runner.py

* [autofix.ci] apply automated fixes

* Update flow_runner tests to match new LangflowRunnerExperimental API (#1)

* Initial plan

* Update test_flow_runner.py to match new LangflowRunnerExperimental API

Co-authored-by: barnuri <13019522+barnuri@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: barnuri <13019522+barnuri@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* patch-1 - fix lint

* patch-1 - tweaks_values

* patch-1 - tweaks_values

* lint

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: barnuri <13019522+barnuri@users.noreply.github.com>
2025-06-26 15:14:35 +00:00
Gabriel Luiz Freitas Almeida
633b1e582a
feat(message): support sequencing of multiple streamable models (#8434)
* feat: update OpenAI model parameters handling for reasoning models

* feat: extend input_value type in LCModelComponent to support AsyncIterator and Iterator

* refactor: remove assert_streaming_sequence method and related checks from Graph class

* feat: add consume_iterator method to Message class for handling iterators

* test: add unit tests for OpenAIModelComponent functionality and integration

* feat: update OpenAIModelComponent to include temperature and seed parameters in build_model method

* feat: rename consume_iterator method to consume_iterator_in_text and update its implementation for handling text

* feat: add is_connected_to_chat_output method to Component class for improved message handling

* feat: refactor LCModelComponent methods to support asynchronous message handling and improve chat output integration

* refactor: remove consume_iterator_in_text method from Message class and clean up LCModelComponent input handling

* fix: update import paths for input components in multiple starter project JSON files

* fix: enhance error message formatting in ErrorMessage class to handle additional exception attributes

* refactor: remove validate_stream calls from generate_flow_events and Graph class to streamline flow processing

* fix: handle asyncio.CancelledError in aadd_messagetables to ensure proper session rollback and retry logic

* refactor: streamline message handling in LCModelComponent by replacing async invocation with synchronous calls and updating message text handling

* refactor: enhance message handling in LCModelComponent by introducing lf_message for improved return value management and updating properties for consistency

* feat: add _build_source method to Component class for enhanced source handling and flexibility in source object management

* feat: enhance LCModelComponent by adding _handle_stream method for improved streaming response handling and refactoring chat output integration

* feat: update MemoryComponent to enhance message retrieval and storage functionality, including new sender type handling and output options for text and dataframe formats

* test: refactor LanguageModelComponent tests to use ComponentTestBaseWithoutClient and add tests for Google model creation and error handling

* test: add fixtures for API keys and implement live API tests for OpenAI, Anthropic, and Google models

* fix: reorder JSON properties for consistency in starter projects

* Updated JSON files for various starter projects to ensure consistent ordering of properties, specifically moving "type" to follow "selected_output" for better readability and maintainability.
* Affected files: Basic Prompt Chaining.json, Blog Writer.json, Financial Report Parser.json, Hybrid Search RAG.json, SEO Keyword Generator.json.

* refactor: simplify input_value type in LCModelComponent

* Updated the input_value parameter in LCModelComponent to remove AsyncIterator and Iterator types, streamlining the input options to only str and Message for improved clarity and maintainability.
* This change enhances the documentation and understanding of the expected input types for the component.

* fix: clarify comment for handling source in Component class

* refactor: remove unnecessary mocking in OpenAI model integration tests
2025-06-25 17:14:08 +00:00
Edwin Jose
38d5885fa3
refactor(agent): standardize memory handling and update chat history logic (#8715)
* update chat history

* update to agents

* Update Simple Agent.json

* update to templates

* ruff errors

* Update agent.py

* Update test_agent_component.py

* [autofix.ci] apply automated fixes

* update templates

* test fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
2025-06-25 16:33:57 +00:00
Edwin Jose
f4bbfd030b
feat: add is_active flag to model providers and update provider filtering (#8588)
* update model constants

* [autofix.ci] apply automated fixes

* update model input constants to reuse the filtered data

* Update test_agent_component.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-24 06:59:14 +00:00
Cristhian Zanforlin Lousa
043ba55718
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>
2025-06-23 14:11:07 +00:00
Mike Fortman
ddc17d4c77
fix: Match front and backend prompt variable behavior (#8522)
* fix handling of braces in front and back end

* add tests

* ruff check fix

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes

* address pr comments and switches to use formatter

* remove code fence that isn't working

* comment

* [autofix.ci] apply automated fixes

* text fix

* style fix

* test fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-18 14:24:39 +00:00
Gabriel Luiz Freitas Almeida
4d3eae63ac
feat: conditionally render voice button based on voice mode state (#8561)
* chore: update webrtcvad dependency and add optional audio support

- Updated webrtcvad version requirement to >=1.9.4 in pyproject.toml and uv.lock.
- Moved webrtcvad to optional dependencies under the new 'audio' category in both pyproject.toml files for better modularity.
- Ensured compatibility with existing dependencies while enhancing documentation for optional audio features.

* fix: handle optional import of voice_mode_router in API initialization

- Updated the API router initialization to conditionally include the voice_mode_router if it is available, improving modularity and preventing import errors.
- Adjusted the import statement for voice_mode_router to handle ImportError gracefully, ensuring the application remains robust in its absence.

* feat: add voice mode flag to API configuration

- Introduced a new function `get_voice_mode_enabled` to check for the availability of the `webrtcvad` library, enhancing the API's capability to support voice mode features.
- Updated the `ConfigResponse` schema to include `voice_mode_enabled` flag, allowing clients to query the status of voice mode support.
- Integrated the voice mode feature flag into the `get_config` endpoint response, improving the configurability of the API.

* test: skip voice mode tests if webrtcvad is not installed

- Added a conditional import for the webrtcvad library in the voice mode test suite.
- Implemented a pytest marker to skip tests when webrtcvad is unavailable, enhancing test robustness and preventing unnecessary failures.

* feat: add voice mode state management to flows manager store

- Introduced `voiceModeEnabled` state and `setVoiceModeEnabled` action in the flows manager store to manage the voice mode feature.
- Updated the `ConfigResponse` interface and `useGetConfig` hook to integrate the new voice mode state, allowing for dynamic configuration updates.
- Enhanced the API's configurability by ensuring the voice mode state is properly set based on the API response.

* feat: conditionally render voice button based on voice mode state

- Integrated `voiceModeEnabled` from the flows manager store to control the visibility of the VoiceButton component.
- The VoiceButton will now return null if voice mode is not enabled, enhancing the user interface by preventing unnecessary rendering.

* fix: ensure boolean conversion for voice mode state in config hook

- Updated the `setVoiceModeEnabled` function in the `useGetConfig` hook to explicitly convert the `voice_mode_enabled` value to a boolean, ensuring consistent handling of the voice mode state based on API responses.

* refactor: conditionally import voice_mode_router in API initialization

- Updated the API router to conditionally include the voice_mode_router based on its availability, enhancing modularity and preventing import errors.
- Adjusted the __init__.py file to dynamically add voice_mode_router to the __all__ list if the import is successful, improving the API's robustness.

* chore: revert mcp version update

* refactor: reorder router initialization and add audio flag to backend install task

* feat: add audio module to backend installation command in VS Code tasks

* ci: add audio extras to uv sync in frontend tests
2025-06-17 15:23:12 +00:00
Jordan Frazier
b77351331d
fix: replace instances of 127.0.0.1 to localhost (#8536)
* Replace instances of 127.0.0.1 to localhost

* fix some replace-all issues

* fix some replace-all issues

* update starterprojects

* Upgrade uvlock
2025-06-16 15:54:04 +00:00
github-actions[bot]
706cb1eec5
chore: update test durations (#8550)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2025-06-16 11:05:18 -03:00
Edwin Jose
e7f78d99cb
refactor: update build_structured_output to return only last output element (#8467)
* Update structured_output.py

* template updates

* Update Financial Report Parser.json

* Update structured_output.py

* Update structured_output.py

* update strcutred output with optimisations

* Update test_structured_output_component.py

* fix lint

* update templates

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Update structured_output.py

* [autofix.ci] apply automated fixes

* Update test_structured_output_component.py

* [autofix.ci] apply automated fixes

* fix image sentiment analysis

* [autofix.ci] apply automated fixes

* Update Image Sentiment Analysis.json

* [autofix.ci] apply automated fixes

* update template with new language model component

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-13 23:02:48 +00:00
Edwin Jose
7aee1bc1c3
refactor: use utility for BaseModel serialization and add SQL component tests (#8437)
* Update component_tool.py

* Update test_component_toolkit.py

* [autofix.ci] apply automated fixes

* Update component_tool.py

* [autofix.ci] apply automated fixes

* Update component_tool.py

* Update component_tool.py

* [autofix.ci] apply automated fixes

* fix tests

* [autofix.ci] apply automated fixes

* Update test_component_toolkit.py

* Update test_component_toolkit.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-13 01:56:57 +00:00
Gabriel Luiz Freitas Almeida
7b687a0e7a
refactor: load components by importing them directly (#8395)
* refactor: update default behavior for components path in Settings class

* Set components path to an empty list when no value is provided, improving clarity in logging.
* Remove redundant addition of BASE_COMPONENTS_PATH when it is not already included.

* feat: Implement importing of Langflow components

* Added `get_langflow_components_list` to asynchronously fetch built-in components using introspection and pkgutil.
* Introduced `_get_langflow_components_list_sync` for synchronous processing of component classes.
* Updated `get_and_cache_all_types_dict` to merge fetched components into the cache.
* Enhanced error handling during module imports and component processing.

* feat: Enhance component handling in custom utils for better flexibility

* refactor: Simplify component retrieval logic and enhance error handling

* refactor: Remove unnecessary 'required_inputs' field from multiple starter project JSON files

* refactor: Change error handling to warning for component instantiation failures

* refactor: Improve component type checking in get_component_instance and run_build_config functions

* refactor: Update subclass check for custom_component in run_build_config function

* refactor: Update component name retrieval logic to prioritize class name

* refactor: Replace settings service call with direct BASE_COMPONENTS_PATH in test_get_all

* refactor: Update required inputs and improve model name info across starter projects

* [autofix.ci] apply automated fixes

* 📝 Add docstrings to `fix-component-loading` (#8397)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Build and log fixes

* refactor: Improve type checking for custom component instances in `get_component_instance`

* refactor: Enhance type checking for custom components in `run_build_config`

* refactor: Clean up docstrings in component loading functions for clarity

* refactor: Rename `get_langflow_components_list` to `import_langflow_components` for clarity

* refactor: Exclude deactivated modules and improve class checking in component loading

* test: Add component differences analysis for import_langflow_components and aget_all_types_dict

* [autofix.ci] apply automated fixes

* refactor: Simplify assert statements and improve logging in component loading tests

* [autofix.ci] apply automated fixes

* refactor: Consolidate __all__ declaration for retriever components

* refactor: Improve comments for clarity in run_build_config function

* [autofix.ci] apply automated fixes

* refactor: Enhance module validation logic in _get_langflow_components_list_sync function

* refactor: Update debug log message for clarity in get_and_cache_all_types_dict function

* refactor: Enhance parallel processing of Langflow components import and improve logging

* refactor: Improve performance testing by adding warm-up runs and clarifying output messages

* refactor: Improve assertion clarity in component loading tests and add performance benchmark

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* Use Component base class instead of custom component for a few components

* ️ Speed up function `get_component_instance` by 365% in PR #8395 (`fix-component-loading`) (#8438)

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* refactor: update debug log message for components cache building

* refactor: update required inputs to use 'api_key' for multiple starter projects

* refactor: update import statement for BaseFileComponent in nvidia_ingest.py

* refactor: simplify timing results print statement in test_load_components.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* refactor: improve assertion readability and error handling in test_load_components.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* feat: allow os.stat in pkgutil for component loading in blockbuster fixture

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* updates few components to new template

* import fixes

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* remove unused VectaraSelfQueryRetriverComponent from vectorstores __all__ export

* Update starter project configurations to require 'api_key' as a mandatory input for model output in multiple JSON files.

* [autofix.ci] apply automated fixes

* Refactor JSONDocumentBuilder by removing TYPE_CHECKING import and update Vectara import statement to suppress linting warning.

* ️ Speed up function `_process_single_module` by 1,017% in PR #8395 (`fix-component-loading`) (#8443)

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* Remove unnecessary call to `_set_output_required_inputs` in `Component` class setup

* Revert "Use Component base class instead of custom component for a few components"

This reverts commit 2fd61f92b2735a770d82eada3b429c4e20657335.

* move components to deactivated folder

AmazonKendraRetriever, JSONDocumentBuilder, ListenComponent, MetalRetrieverComponent, MultiQueryRetrieverComponent, NotifyComponent, RetrieverToolComponent, and VectaraSelfQueryRetrieverComponent

These components provide various functionalities including document building, notification handling, and integration with external APIs for data retrieval. Each component includes input specifications and error handling for robust operation.

* [autofix.ci] apply automated fixes

* Revert "move components to deactivated folder"

This reverts commit 0aa17a26d938f4a5ea622e16c4645813ea271e44.

* Implement multiple new components in the deactivated folder, including AmazonKendraRetrieverComponent, JSONDocumentBuilder, ListenComponent, MetalRetrieverComponent, MultiQueryRetrieverComponent, NotifyComponent, RetrieverToolComponent, and VectaraSelfQueryRetrieverComponent. Each component is designed to enhance functionality for document handling, notifications, and API integrations, with robust input specifications and error handling for improved reliability.

* feat: Enhance starter project loading with improved logging and error handling

* refactor: Remove debug logging for module processing in import_langflow_components

* [autofix.ci] apply automated fixes

* fix: Disable mypy error for undefined attributes in deactivated components

* feat: Enhance blocking behavior in blockbuster tests with additional function checks

* fix: Add import error handling for boto3 in S3BucketUploaderComponent

* refactor: Add debug logging for module processing in components

* fix: Temporarily disable auto-use for blockbuster fixture until blocking issue is resolved

* feat: Add utility function to check for preimported components

* fix: Update get_component_instance to accept both CustomComponent and Component types

* fix: Update import error message for boto3 installation instructions

* fix: Correct class name from VectoStoreRetrieverComponent to VectorStoreRetrieverComponent

* fix: Update Vectara type hints and import statements for consistency

* fix: Refactor get_component_instance and build_custom_component_template_from_inputs for improved error handling and component instantiation

* fix: Remove debug logging from _process_single_module to streamline module processing

* ️ Speed up function `is_a_preimported_component` by 24% in PR #8395 (`fix-component-loading`)
Here is an optimized version of your program.



**Reasoning for changes:**
- The check `isinstance(custom_component, Component)` followed by `type(custom_component) is not Component` causes the interpreter to potentially look up the type and MRO twice per call.
- By storing `type(custom_component)` in `klass` and using `issubclass(klass, Component)`, you avoid having Python walk the MRO twice for the same object, which is subtly more efficient especially in tight loops and heavy use scenarios.
- Using `issubclass()` on the object's type is semantically equivalent to `isinstance()`, except it also works for custom metaclass scenarios and is very slightly faster when type is already known.

**All program logic and comments are preserved, only the relevant portion is optimized.**

*  (freeze.spec.ts): introduce new function addFlowToTestOnEmptyLangflow to enhance test coverage and improve test reliability

*  (freeze.spec.ts): increase timeout value for waiting for "built successfully" text to appear to improve test reliability

*  (freeze.spec.ts): refactor code to check if firstRunLangflow is greater than 0 before calling addFlowToTestOnEmptyLangflow
🔧 (generalBugs-shard-9.spec.ts): update tags in test case to include @workspace and @components
♻️ (generalBugs-shard-9.spec.ts): refactor code to remove unnecessary steps related to sidebar search and node handling
🔧 (store-shard-0.spec.ts): update test cases to be skipped and improve readability by using async arrow functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>
Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-06-11 22:36:35 +00:00
Lucas Oliveira
60ccdb500f
feat: add servers persistence to MCP connection component, add MCP connections settings page (#8388)
* Added mcpinput to the backend

* Fixed list selection component to contain descriptions

* Added mcp component in the frontend with mock values

* Added mcp rendering on Parameter Render Component

* Changed input to be more concise and to have dynamic placeholder

* Added header search placeholder

* Fixed styling to match new input

* Removed unused params

* Adds AddMcpServerModal's first mock version

* Adds Add button on mcp component and list selection component

* First pass at mcp api

* Add PATCH endpoint

* Add DELETE endpoint

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* fix: Update Pokédex Agent template (#8373)

* Implement adding and getting MCP servers, implemented addMcpServerModal

* Added sse and stdio ways of adding a server

* Added no actions handling

* added new mcp type to constants

* Added headers to add mcp server modal

* Changed mcp component to allow persistent mcp servers

* fix input list component gradient

* fix add server modal to patch when initial data is present, and to clean variables when switching tabs

* changed message on add mcp server

* Added required mutations for mcp page

* Added mcp servers page

* Changed design of page

* Fixed delete problems and added delete confirmation

* fixed wrong error parsing

* changed padding

* Made added server be used on mcp component

* refactor: remove references to the langflow store (#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)

* Fixed search on sidebar

* fixed infinite use effect

* Fixed error handling

* Fixed tool mode disappearing

* fixed key pair button submitting form

* Fixed bugs

* Added required

* Changed message

* Disabled other tabs when modifying

* Removed tool dropdown if the mcp server is empty

* parsed name

* fixed data test id not applying

* fixed mcp component

* Fixed component not working when only stdio command is present

* refactored tests

* Updated mcp_component to remove old non default keys

* Added data-testids

* Modified tests to include settings page functionality

* [autofix.ci] apply automated fixes

* Refactor out the core part of the mcp

* [autofix.ci] apply automated fixes

* Added placeholders on frontend components for errors

* Fixed bugs with mcp component

* updated bug

* fix: made empty project appear instead of empty flows list when mcp is enabled (#8336)

* try to fix

* Fix MCP persistence

* Update mcp_component.py

* Update mcp.py

* [autofix.ci] apply automated fixes

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* refactor: remove references to the langflow store (#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)

* fix: made empty project appear instead of empty flows list when mcp is enabled (#8336)

* fix mcp client async problems

* fixed mcp sse access

* [autofix.ci] apply automated fixes

* Made values be maintained when refreshing page

* Fixed bugs with tool mode and switching from tool mode to not tool mode

* Update mcp_component.py

* Update test_mcp_component.py

* Don't expose file by name as external endpoint

* Update files.py

* Update files.py

* Add checks for id

* Refactor tests

* Update test_mcp_component.py

* Update test_mcp_component.py

* Update test_mcp_component.py

* updated tests

* re-added placeholder on input for tests to not fail

* updated session selector in order for tests to work

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-06-11 19:21:38 +00:00
Lucas Oliveira
8fd8be52aa
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>
2025-06-11 14:10:22 +00:00
Eric Hare
e5e54ea606
fix: Split text should only have dataframe output (#8362)
* fix: Split text should only have dataframe output

* [autofix.ci] apply automated fixes

* Update templates

* test fix

* Update Vector Store RAG.json

* Update starter projects

* fix tests

* add shards

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-06-10 19:21:15 +00:00
Jordan Frazier
f2e3f2ccc5
ref: standardize imports to use full qualified names (#7575)
* Remove models from __init__.py to avoid circular dependency

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* add back init to avoid backwards-compat issues

* [autofix.ci] apply automated fixes

* ref: standardize imports to use full qualified names

Replaces uses of the "public" APIs to use full qualified
names to reduce instances of circular dependencies

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Fix path

* update starters"
"

* remove old files'

* [autofix.ci] apply automated fixes

* Fix some imports

* [autofix.ci] apply automated fixes

* ruff

* [autofix.ci] apply automated fixes

* starter projects?

* starter projects?

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-09 15:20:34 +00:00
Yuqi Tang
e23e543b60
feat: combine chat history and chat store into a CRUD component (#8323)
* combine history and store

* combine history and store

* [autofix.ci] apply automated fixes

* Update memory.py

* [autofix.ci] apply automated fixes

* update json

* Update memory.py

* Update memory.py

* [autofix.ci] apply automated fixes

* change order

* change order

* put retrieve first

* add json

* [autofix.ci] apply automated fixes

* Update memory.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* update test

* fix test

* update tests

* update memory_chatbot

* change number back

* fix py test

* update

* update pokedex

* update flow

* [autofix.ci] apply automated fixes

* update type converter

* format

* fix name

* update meeting summary

* [autofix.ci] apply automated fixes

* fix test memory chatbot

* update method

* update method

* fix sort

* fix test graph state

* fix test

* fix locator

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-06-05 22:19:01 +00:00
Gabriel Luiz Freitas Almeida
8925c86853
fix: Add os.stat to blocklist for _load_revisions in alembic script (#8365) 2025-06-04 09:08:32 -03:00
Eric Hare
9aaca68687
fix: Refactor a few more components to proper folders (#8324)
* fix: Refactor a few more components to proper folders

* Rename action for load files

* [autofix.ci] apply automated fixes

* Update tests for new naming

* Update video_file.py

* Update video_file.py

* Update video_file.py

* Update test_batch_run_component.py

* Move unit tests

* Update test_structured_output_component.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
2025-06-03 23:35:46 +00:00
Abhishek Patil
f835a6b4dd
feat: Add Composio Outlook component (#7987)
* feat: add Composio Outlook component

* feat: add Composio Outlook component

* feat: add outlook test file

* chore: remove file

* fix: format

* fix: add result_field to improve toolcall response

* Update src/frontend/src/icons/outlook/outlook.jsx

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-06-03 16:28:24 +00:00
Gabriel Luiz Freitas Almeida
8fb9750a7b
fix: Fix Anthropic output processing and update dependency (#8283)
* chore: update langchain-anthropic dependency to version 0.3.14 and adjust revision in uv.lock

* fix: add workaround for handling function calling in Anthropic output processing

* Fix indentation

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: remove duplicate error message in _extract_output_text function

* fix: update _build_llm_model to handle missing attributes gracefully

* fix: handle max_tokens default value and improve error handling in AnthropicModelComponent

* fix: enhance input handling in Component class to manage deepcopy errors

* fix: add 'no_blockbuster' marker to pytest configuration for improved test control

* fix: refactor agent component tests to include all OpenAI and Anthropic models, improving validation and error reporting

* fix: update agent components to include pydantic validation and improve error handling across multiple starter projects

* fix: set default max_tokens value in AnthropicModelComponent and improve API URL handling

* fix: enhance error reporting in AgentComponent tests by capturing exceptions and response discrepancies for all Anthropic models

* chore: update package versions in uv.lock, including alembic, arize-phoenix-otel, bce-python-sdk, boto3-stubs, botocore-stubs, tornado, and others for improved compatibility and features

* fix: update agent components across multiple starter projects to include new imports and improve error handling

* fix: streamline max_tokens handling in AnthropicModelComponent for improved clarity and robustness

* [autofix.ci] apply automated fixes

* fix: update artifacts_raw type to allow None for better flexibility

* fix: initialize artifacts_raw as an empty dict if None to prevent errors

* fix: specify type for similarity_score to enhance type safety and clarity

* fix: refactor JSON parsing to improve variable naming and clarity

* fix: skip flaky test in Portfolio Website Code Generator until stabilized

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-06-03 14:58:13 +00:00
Edwin Jose
360836800d
feat: add convert component with dynamic output support (#7773)
* Create convertor.py

* [autofix.ci] apply automated fixes

* convert component

* [autofix.ci] apply automated fixes

* add Type_conversion base class with dispatchers for performance based conversion

* fix lint issues

* add type_convertor test

* [autofix.ci] apply automated fixes

* update tests

* fix tests

* update with auto conversion methods

* update function to component file

* feat: enhance input validation for Data, DataFrame, and Message types

* test: add unit tests for DataInput, MessageInput, and DataFrameInput data conversion

* updated changes to use type classes

* [autofix.ci] apply automated fixes

* add convert logic

* update converts

* Update converter.py

* [autofix.ci] apply automated fixes

* revert converter.py

* Update inputs.py

* Update test_inputs.py

* update to logic

* Update test_type_convertor_component.py

* update converter

* [autofix.ci] apply automated fixes

* refactor: rename conversion functions for clarity

Updated function names for converting inputs to Message, Data, and DataFrame types to improve readability and consistency. The changes include renaming `get_message_converter` to `convert_to_message`, `get_data_converter` to `convert_to_data`, and `get_dataframe_converter` to `convert_to_dataframe`. Additionally, added a check for dictionary input in the data conversion function.

* fix: add TYPE_CHECKING for conditional imports in message.py

Introduced TYPE_CHECKING to optimize imports for the DataFrame type, ensuring that the import only occurs during type checking. This change enhances performance and maintains compatibility with static type checkers.

* refactor: simplify data conversion methods in Message class

Removed unnecessary parameters from the `to_data` and `to_dataframe` methods in the Message class, enhancing clarity and reducing complexity. The methods now directly use instance attributes, improving code readability and maintainability.

* refactor: enhance DataFrame methods for clarity and type safety

Updated the `to_data` and `to_message` methods in the DataFrame class to improve clarity and type safety. The `to_data` method now directly converts the DataFrame to a Data object without parameters, and the `to_message` method uses the instance's data directly. Added TYPE_CHECKING for conditional imports to optimize performance and maintain compatibility with static type checkers.

* refactor: streamline Data class methods for improved clarity

Refactored the `to_message` and `to_dataframe` methods in the Data class to eliminate unnecessary parameters and directly utilize instance attributes. This change enhances code readability and maintainability while ensuring type safety with the appropriate imports for Message and DataFrame. Additionally, updated the logic to access instance data more intuitively.

* refactor: simplify conversion method calls by removing redundant arguments

* rename test file

* refactor: remove obsolete test file for data conversion

* refactor: add support for converting dictionary to DataFrame

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
2025-06-02 20:06:56 +00:00
Gabriel Luiz Freitas Almeida
d50c90522e
fix: correct loop component dependencies (#8091)
* feat: Minimal experiment with zipping pre- and post-loop lists

Update test JSON to demonstrate a simple workflow using custom components for sequence generation and zipping, with a loop component to process the data. The changes include:

- Replaced previous components with custom components
- Added a sequence maker component
- Added a zipper component
- Configured loop component to work with the new components
- Updated flow description and last tested version

* feat: Refactor Loop Test workflow with enhanced component interactions

Update LoopTest.json to demonstrate a more complex data processing workflow:
- Modify MyZipper component to return Message instead of Data
- Update Loop component's stop condition logic
- Adjust node positions and connections
- Upgrade last tested version to 1.2.0

* test: Enhance Loop Component Test with JSON Parsing and Assertion

Add more robust testing for the Loop component by:
- Parsing TextOutput event from the response
- Extracting and parsing JSON data
- Adding detailed assertions to verify loop output
- Improving test coverage for loop component interactions

* refactor: simplify LoopTest.json structure and update node definitions

- Reduced the size of LoopTest.json by removing unnecessary edges and nodes.
- Updated node definitions for `ParseData` and `MessagetoData` components to enhance clarity and maintainability.
- Adjusted connections between nodes to reflect the new structure, ensuring proper data flow.
- Improved documentation within the JSON structure for better understanding of component functionalities.

* feat: add method to retrieve incoming edge by target parameter

- Implemented `get_incoming_edge_by_target_param` method in both `Component` and `Vertex` classes to facilitate the retrieval of source vertex IDs for incoming edges targeting specific parameters.
- Enhanced performance by caching outgoing and incoming edges in the `Vertex` class to avoid redundant calculations.

* feat: add dependency update method in LoopComponent

- Introduced `update_dependency` method to manage dependencies for the next iteration in the loop.
- Refactored existing logic to ensure proper handling of current items and loop termination conditions.
- Enhanced code clarity and maintainability by restructuring the flow of data processing within the loop.

* [autofix.ci] apply automated fixes

* refactor: update message assertions in TestLoopComponentWithAPI for accuracy

* feat: enhance LoopTest.json structure and component definitions

- Expanded the LoopTest.json file to include additional nodes and edges, improving the representation of component interactions.
- Updated definitions for `MyZipper`, `LoopComponent`, `MessagetoData`, and `ChatOutput` to enhance clarity and functionality.
- Introduced new properties and methods in components to support better data handling and processing.
- Improved documentation within the JSON structure for better understanding of component functionalities and usage.

* feat: add ran_at_least_once tracking to RunnableVerticesManager

- Introduced a new set, `ran_at_least_once`, to track vertices that have been executed at least once.
- Updated serialization methods to include the new property for state management.
- Enhanced logic in `all_predecessors_are_fulfilled` to prevent infinite loops for loop vertices that have already run.

* fix: add error handling for missing vertex in Component class

* refactor: improve variable naming and enhance readability in TestLoopComponentWithAPI

* feat: track vertex execution in run_manager by adding ran_at_least_once tracking

* feat: Enhance LoopComponent with dependency management and improved item output handling

- Added a method to update dependencies for the LoopComponent to ensure proper execution order.
- Improved item output logic to handle stopping conditions more effectively and update dependencies for subsequent runs.
- Refactored the item_output method to streamline the flow of data processing and context management.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-06-02 19:56:48 +00:00
Lucas Oliveira
d3d06be8e5
feat: add one click install to mcp servers on specific clients (#8271)
* Added endpoint to add servers to local backend

* Add install mcp query

* Fixed mcp projects to receive body schema

* Added patch install to mcp server tab

* feat: adds new Edit Details popover, removes flow menu, fixes nav alignment, adds new Flow Status overlay (#8087)

* Updated flow settings component size

* Added FlowSettingsComponent to contain modal content

* Removed unused imports

* Changed Flow Settings Modal to use new component

* Changed Flow Menu styling, removing Saved and context menu, and adding a direct click to edit flow info

* Removed unused styling

* Updated nav position and truncation

* updated alert styling

* Added z index to header

* Added flow settings coming from the bottom

* Changed flow settings to not crash when there is no flow

* Removed unused imports

* Implemented flow details using popover

* Removed onClick

* Changed canvas controls position and color

* Changed panel tooltip side and classes

* Added log canvas component

* Added children to flow logs modal

* Added log canvas component into page

* Changed position and shadow of canvas controls

* removed endpoint name from edit flow settings

* added endpoint name change into tweaks modal

* Added endpoint editing to tweaks

* Implemented storing the error in the flowBuildStatus

* Updated type

* Added Flow Building Component

* Added Flow Building Component implementation

* Added red color

* Added past build flow params

* Implemented design of flowBuildingComponent

* Implemented build error storing on flowStore

* Implemented build error on flow store

* Changed notifications test

* Set build error as null when building

* Reset build error when exiting flow

* Changed from error to buildError

* Changed flowStore to have buildInfo instead of buildError

* Changed flowBuildingComponent to have buildInfo and display successful builds

* Added handleDismissed instead of setting dismissed as true

* Updated tests to current Update implementation

* Updated tests to remove click on built successfully

* Updated tests and data-testid to match new Flow Name editing behavior

* fixed auto login test

* Fixed edit-flow-name test and save changes on node

* fixed tests

* Changed Share to Publish and added test ids

* added Rename Flow util for tests

* Changed tests to use new RenameFlow

* Fixed auto save off

* Added data test id to flow building component

* Removed pulsing from Name Invalid

* Made name editable but not saveable when invalid

* Added character name reached on description

* Added transition on pencil

* Modularized alert store to separate notification history and notifications

* Added errors to notification history

* Fixed flow building component position and update all components

* Fixed animations

* Fixed animation

* Added same animation to Update All Components

* Updated animations to make update only appear when flow building is not appearing

* fix flow settings test

* Fixed build status not being redefined

*  (UpdateAllComponents/index.tsx): Refactor containerVariants to CONTAINER_VARIANTS for consistency and readability
📝 (visual-variants.ts): Add visual variants for buttons and time in flowBuildingComponent
♻️ (flowBuildingComponent/index.tsx): Import visual variants from separate file for better organization and maintainability

* Fixed offset width of time

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>

* fix: fix regex on mcp server tab test (#8175)

* Fixed MCP Server Tab Test

* Fixed mcp server tab test

* Added timeout to test

* Added retry to mcp server tab test

* docs: cookie-banner-link (#8179)

cookie-banner-link

* fix: removed fit view that caused duck duck go test to fail (#8178)

fixed duck duck go test to not fail

* feat: Enhance API request component (#8070)

* update the api request component

* [autofix.ci] apply automated fixes

* update the component

* Update test_api_request_component.py

* [autofix.ci] apply automated fixes

* remove MODE_CONFIG unused variable

* [autofix.ci] apply automated fixes

* use normalize function

* Update template

* Update test_api_request_component.py

* UI test fix

* selector fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>

* docs: system assist component (#8089)

* sidebars

* initial-content

* more

* update

* trailing-spaces

* example

* standardize-naming

* shorten-introduction-and-remove-client

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

* Update docs/docs/Integrations/Nvidia/integrations-nvidia-system-assist.md

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

* docs: deploy langflow with caddyfile and docker compose (#8120)

* initial-content

* not-json

* clarify-public key

* more-accessible-name-and-context

* exit-session

* fix: simplify GetStartedProgress percentage calculation logic (#8183)

🐛 (get-started-progress.tsx): fix calculation of totalPercentage to correctly display progress bar percentage
💡 (get-started-progress.tsx): refactor logic to calculate totalPercentage based on user opt-ins and flows

* fix: set cursor to text in text fields (#8173)

Fixed cursor being default in input fields

* feat: add datastax components bundle (#8184)

* feat: add datastax components bundle

* Update __init__.py

* Remove old astra assistants folder

* Remove old tools

* Update __init__.py

* Update test_assistants_components.py

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>

* feat: updated components header styling (#8085)

* Removed unused styles

* Updated node icon to follow design

* Updated node name to follow design and include Beta

* Removed Beta from node status

* Removed unused classes and parameters from GenericNode

* Changed node description padding on input

* Changed paddings and gaps

* removed unused classes

* Added accent purple foreground color to Experimental

* Fixed classes and gaps in generic node

* Fixed node name gaps

* Fixed node status classes and styling

* Removed unused classes and changed run-bg size

* Changed test to use new test id

* Changed Node Name to have beta tooltip

* Changed Build Failed icon to be a circle alert

* Changed Node Status gap and conditions to show spacings correctly

* Changed padding to not change height of other components

* Changed nodeStatus to show validation on small node

* Changed classes to show correct spacing and overflow

* Changed description size

* Fixed description text size

* Fixed input margin

* Fixed description editing not appearing when no description is available

* Fixed status not breaking words

* Updated colors

* Updated node output color

* [autofix.ci] apply automated fixes

* Changed duration style in chat

* Re-added output color

* Updated timeout on mcp server tab test

* Added more timeout to mcp server tab test

* fixed loop component test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* ref: SQL component (#8185)

* update sql

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: Loop uplift dataframe input and output (#8177)

* tests cases

* update to loop

* Update component.py

* 📝 (LoopTemplate.json): update value of a configuration key from "OPENAI_API_KEY" to "ANTHROPIC_API_KEY" in order to reflect the correct API key being used

* update json test loop

* add dataframe support for the loop component

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* fix: starter project

* update loop component and tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* update logic

* Update loop_basic.py

* Update Research Translation Loop.json

* fix lint

* format fix

* [autofix.ci] apply automated fixes

* reverting changes in component and vertex base

* [autofix.ci] apply automated fixes

* fix lint errors

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* update in the loop templates and component

* [autofix.ci] apply automated fixes

* Update Research Translation Loop.json

* update tests

* update the code and deprecate the old loop

* [autofix.ci] apply automated fixes

* Update loop_basic.py

* WIP FIX Loop Tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

*  (loop-component.spec.ts): Update test cases to use more descriptive names for components and actions for better clarity and understanding.

*  (loop-component.spec.ts): refactor loop component tests to improve readability and maintainability by updating test selectors and removing redundant test steps

* update

* Update loop-component.spec.ts

* Update Research Translation Loop.json

* Update Research Translation Loop.json

* Update Research Translation Loop.json

* Update Research Translation Loop.json

* loop test fix

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Rodrigo <rodrigosilvanader@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>

* fix: fixes nightly tests (#8194)

* fix: mcp test when there are a lot of flows (#8197)

* Added cursor and claude in icons

* Added one click install to cursor and claude

* Changed design of mcp server tab page

* Added function to get local platform

* Added platform specific installer json on mcp server tab

* Added FA icons for windows and linux

* Added icons to tabs

* Added endpoint to check for installed MCP servers

* Added use get installed MCP servers

* Changed to get installed

* Use installed MCP servers on server

* Correct instalation for windows and WSL

* Fixed code not selecting

* refactor: use session_scope for database session management in install_mcp_config

* refactor: change logger level from info to debug for WSL and Windows detection in install_mcp_configg

* refactor: replace subprocess with asyncio for WSL IP address retrieval in install_mcp_config

* refactor: streamline project MCP server handling and improve SSE connection management in mcp_projects.py

* refactor: remove unnecessary user dependency from project endpoints in mcp_projects.py

* refactor: unify database session management using session_scope in mcp_projects.py

* refactor: enhance project tool listing and logging in mcp_projects.py by using session_scope and changing logger level to debug

* refactor: simplify WSL detection logic in install_mcp_config by removing unnecessary variable and streamlining conditions

* Removed unused console.log

* Implemented check if Langflow is running on local machine

* Fixed backend to generate an error if trying to install from not local

* Added error handling to frontend and changed loading

* Fix check of macos

* Refactored mcp server tab test to work with new changes

* Fixed test to pass with Windows selected and check the status of Linux too

* [autofix.ci] apply automated fixes

* Changed wait for timeout for wait for selector

* Fixed path.open

* Refactor test_update_project_mcp_settings to use session_scope for database service mock

* Refactor tests in test_mcp_projects.py to utilize session_scope for database session management, improving consistency and readability.

* Updated wsl to uvx

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Rodrigo <rodrigosilvanader@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-06-02 19:21:02 +00:00
Deon Sanchez
5c40410f00
refactor: improve output selection logic and edge updating in GenericNode (#8254)
* refactor: improve output selection logic and edge updating in GenericNode

* feat: enhance output rendering logic for loop and conditional components

* feat: add group_outputs flag to output components for enhanced display control

* feat: enhance output handling by adding support for hidden outputs in NodeOutputs component

* fix: update display output logic to handle tool mode correctly

* fix: improve output selection logic in NodeOutputs component

* refactor: simplify output selection logic in OutputComponent and GenericNode

* refactor: remove commented code and clean up unused memoization in various components

* refactor: clean up NodeOutputs component by removing commented code and simplifying output logic

* [autofix.ci] apply automated fixes

* feat: add group_outputs field to test_output in schema tests

* test: Skip grouped components output preview test and add wait times for stability

* fix: remove 'group_outputs' property from multiple starter project JSON files

* Revert starter_projects folder to main branch state

* Revert starter_projects folder to match origin/main exactly

* Re-sync starter_projects folder with main branch after merge conflict

* Add "group_outputs" property to various agent configurations

* test: skip progress tracking test for admin users

* test: enable progress tracking for admin users and improve component interaction

* test: remove redundant dropdown interaction and enhance multi-select functionality

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-06-02 18:03:26 +00:00