Commit graph

14,892 commits

Author SHA1 Message Date
星月之辉
33a792242d
fix: the database url is missing ":\\" when sqlite or postgresql is not used (#5492)
* 【bugfix】 the database url is missing ":\\"

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* [fix] improve the code to make it easier to understand

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-10 11:45:14 +00:00
Gabriel Luiz Freitas Almeida
9c23759c7d
refactor: add graph utility tests and refactor sorting methods (#5538)
* refactor: turn sorting methods into functions in a separate module

- Added `layered_topological_sort` function to perform layered topological sorting of graph vertices, accommodating cycles and input vertex checks.
- Introduced `refine_layers` function to ensure proper dependency ordering among vertices.
- Implemented helper functions for sorting layers by dependency and filtering vertices based on predecessors.
- Enhanced utility functions to support better graph traversal and layer management.

This update improves the graph processing capabilities, allowing for more efficient handling of complex graph structures.

* feat(tests): enhance graph utility tests with cycle detection and sorting functionality

- Added a new fixture `graph_with_loop` to simulate a graph containing cycles for testing purposes.
- Improved the `test_large_graph_efficiency` to validate cycle detection in large graphs.
- Introduced multiple tests for sorting vertices in graphs with cycles, ensuring correct order and handling of input vertices.
- Enhanced assertions to provide clearer error messages for failed tests, improving debugging experience.

These changes strengthen the testing framework for graph utilities, ensuring robust handling of complex graph structures.

* refactor(graph): remove unused parent_node_map from Graph class initialization

- Eliminated the `parent_node_map` parameter from the Graph class constructor, streamlining the graph initialization process.
- This change enhances code clarity and reduces unnecessary complexity in graph management.

This update contributes to cleaner and more maintainable graph-related code.

* refactor(graph): optimize dependency sorting and vertex filtering

- Improved the `_max_dependency_index` function by utilizing `index_map.get()` for cleaner code and better handling of missing successors.
- Enhanced the `_sort_single_layer_by_dependency` function with a caching mechanism to avoid redundant calculations, improving performance during vertex sorting.
- Updated `filter_vertices_up_to_vertex` to use a set for `vertices_ids`, optimizing membership checks and enhancing efficiency in vertex filtering.

These changes contribute to more efficient graph processing and improved code readability.

* chore: remove unused 'parent_node_map' parameter

* [autofix.ci] apply automated fixes

* fix: replace old method call with a new func

* test: enhance assertions for file existence in webhook tests

* refactor(graph): enhance component ID retrieval and chat input sorting

- Updated `find_start_component_id` to accept an optional `is_webhook` parameter, allowing for dynamic priority input selection based on the flow type.
- Improved `sort_chat_inputs_first` to handle chat input positioning more efficiently, ensuring only one chat input exists and adjusting its position within the layers as needed.
- These changes enhance the flexibility and efficiency of graph processing, particularly for webhook flows.

* test(graph): update assertions in sort_chat_inputs_first test for accuracy

- Modified assertions in the `test_chat_inputs_at_start` function to reflect the correct expected output of the `sort_chat_inputs_first` utility.
- Adjusted the expected length and order of the result to ensure accurate validation of chat input sorting functionality.

These changes enhance the reliability of the test suite for graph utilities, ensuring that the sorting logic is correctly validated.

* test(chat): update assertion in consume_and_assert_stream for accurate ID validation

- Modified the assertion in the `consume_and_assert_stream` function to include an additional expected ID, ensuring the test accurately reflects the current output of the chat endpoint.
- This change enhances the reliability of the test suite by validating the correct behavior of the chat input sorting functionality.

* test(endpoints): update assertion in test_get_vertices for accurate ID validation

- Modified the assertion in the `test_get_vertices` function to include an additional expected ID, "Webhook", alongside "ChatInput".
- This change ensures the test accurately reflects the current output of the endpoint, enhancing the reliability of the test suite for endpoint functionality.

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-09 20:15:24 +00:00
Pedro Pacheco
319380462e
feat: add Graph Rag template Renamed template file name (#5604)
* Renamed template file name

* Removed keyspaces

* add global variables and update description

* add icon and tags for the example

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-09 19:18:47 +00:00
Raphael Valdetaro
249f000d12
feat(component): enhance chat input component (#5131)
* feat(component): enhance chat input component

- Replace MultilineInput with StrInput for better text handling
- Remove input handle for cleaner playground integration
- Maintain image support through FileInput
- Keep essential styling and session management options

* refactor(chatinput): keep MultilineInput with empty input_types

Keep MultilineInput for text composition advantage but hide the handle
for UI cleanliness by setting input_types=[].

This preserves the multiline functionality while improving the visual
interface by removing the unnecessary connection handle.

* [autofix.ci] apply automated fixes

* refactor: Update test_cycle_in_graph_max_iterations to use TextInputComponent instead of ChatInput

- Replaced ChatInput with TextInputComponent in test_cycle_in_graph_max_iterations.
- Updated related method calls to reflect the change in component type.
- Ensured that the graph's run queue correctly references the new input component.

* [autofix.ci] apply automated fixes

* Fix type mismatch in cycle test and skip OpenAI-dependent tests

---------

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: Eric Hare <ericrhare@gmail.com>
2025-01-09 16:40:18 +00:00
anovazzi1
7e8151ddbf
fix: remove upper size limit for Notes (#5425)
refactor: Remove limit constants and styles from NoteNode component allowing infinity resize
2025-01-09 15:29:59 +00:00
Cristhian Zanforlin Lousa
c5d90d1e2d
feat: Update Simple Agent example with latest Calculator version (#5609)
update basic example simple agent
2025-01-09 14:39:10 +00:00
Lucas Oliveira
0c2de6691d
fix: restored save on change, simplified tool_mode attribution to make it work between updates (#5599)
* Fixed flowStore to run autoSave on setNode

* Fix isToolMode from GenericNode to take already set value from node

* Removed tool_mode from the usePostTemplateValue params, inserting it into inly the payload

* Removing tool_mode from usePostTemplateValue use

* Made toolMode be passed in mutateTemplate

* Refactored activateToolMode to make it work between updates

* Added autoSaveFlow dependency into useEffect

*  (general-bugs-save-changes-on-node.spec.ts): add test to verify that any changes made on the node are saved on user interaction

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-01-09 13:58:57 +00:00
anovazzi1
1f614ccca6
fix: Add factor to prevent overlap (#5426)
* fix: add random factor to prevent overlap

* update package.lock

* feat: Add positionDictionary and related functions to FlowStoreType

* feat: Add buildPositionDictionary function to reactflowUtils.ts

* feat: Add buildPositionDictionary function to reactflowUtils.ts

This commit adds the buildPositionDictionary function to reactflowUtils.ts. This function is used to build a dictionary of positions for nodes in the flow. It is necessary for managing the positions of nodes and preventing overlap.

* fix: Remove random factor from paste function in PageComponent

* [autofix.ci] apply automated fixes

* feat: Add setPositionDictionary function to PageComponent

This commit adds the setPositionDictionary function to the PageComponent in order to set the position dictionary for the flow. This function is used to update the position dictionary when the canvas is moved or resized.

Co-authored-by: [Author Name]

* [autofix.ci] apply automated fixes

* Refactor position calculation in useFlowStore

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-09 13:55:59 +00:00
anovazzi1
f8ca6d4980
Refactor: Update EditNodeComponent to hide table options and block hide (#5513) 2025-01-09 13:48:30 +00:00
Deon Sanchez
5280f396ef
feat: add Store API Key management functionality (#5596)
* feat: add Store API Key management functionality

- Introduced a new Store API Key page for managing API keys related to the Langflow Store.
- Updated routes to include the new StoreApiKeyPage and added a corresponding link in the SettingsPage.
- Enhanced the API key management interface with a dedicated form for inputting and saving API keys.
- Updated existing constants and titles for clarity, ensuring consistent terminology across the application.

This addition improves user experience by providing a centralized location for managing store-related API keys.

* feat: conditionally add Langflow API Keys section in SettingsPage

- Imported ENABLE_DATASTAX_LANGFLOW feature flag to control the visibility of the Langflow API Keys section in the sidebar.
- The API Keys section is now conditionally rendered based on the feature flag, enhancing the flexibility of the SettingsPage.
- This change improves user experience by ensuring that only relevant options are displayed based on the current feature configuration.

* feat: refactor SettingsPage to improve sidebar navigation

- Consolidated the addition of Langflow API Keys and Store sections into a single array for better organization and readability.
- Enhanced the conditional rendering logic for sidebar navigation items based on the ENABLE_DATASTAX_LANGFLOW feature flag.
- This refactor improves maintainability and clarity of the SettingsPage component.

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2025-01-09 00:02:07 +00:00
Rodrigo Nader
75c3c1ce97
feat: add batch run beta component (#5489)
* feat: add batch run beta component

* [autofix.ci] apply automated fixes

* Update batch_run to run async using Runnable

* [autofix.ci] apply automated fixes

* refactor: streamline BatchRunComponent by removing unused synchronous model invocation and enhancing async processing

- Consolidated imports and improved type checking for LanguageModel.
- Simplified the run_batch method by directly using the model's asynchronous capabilities.
- Enhanced error handling for missing DataFrame columns.
- Cleaned up comments and improved code readability.

* refactor: update BatchRunComponent to use Runnable for improved async processing

- Added future annotations for better type hinting.
- Replaced LanguageModel with Runnable in type checking and method implementation.
- Enhanced code clarity and maintainability by consolidating imports.

* test: add unit tests for BatchRunComponent functionality

- Introduced a new test suite for BatchRunComponent to validate its behavior.
- Added tests for successful batch runs with and without system messages.
- Implemented tests for handling invalid column names and empty DataFrames.
- Included a test to ensure non-string columns are converted to strings during processing.

* refactor: rename useful.py to mock_language_model.py and update imports

---------

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-01-08 19:49:11 +00:00
Samuel Matioli
3df81309bf
feat: astra db chunks deletion based on metadata field (#5537)
* feat: Add deletion_field parameter to AstraDBVectorStoreComponent for document management

- Introduced a new 'deletion_field' input to specify a metadata field for deleting documents before loading new data.
- Enhanced the _add_documents_to_vector_store method to handle document deletion based on the specified field, improving data management capabilities.

* Merging with main

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* - Enhanced the info string for the 'deletion_field' parameter to improve readability.
- Optimized the deletion logic by using a set comprehension to eliminate duplicates when gathering delete values from documents.

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/components/vectorstores/astradb.py

Co-authored-by: Madhavan <msmygit@users.noreply.github.com>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Madhavan <msmygit@users.noreply.github.com>
2025-01-08 18:18:54 +00:00
Akshay Kripalani
c5528c6f93
fix: Google Embeddings model dimension mismatch. (#5502)
* Fix Google Embeddings model dimension mismatch.

* edit model size

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-01-08 17:48:51 +00:00
William Bilibio
5381ee1d90
Fix: Fixed agent not found in SequentialCrewComponent. (#5449)
* fix: agents not found in SequentialCrewComponent #4959

* translate texts

* [autofix.ci] apply automated fixes

* Update sequential_crew.py

Removed Agent import

---------

Co-authored-by: William Bilibio <bilibio@vaidebolsa.com.br>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-08 17:28:59 +00:00
Cristhian Zanforlin Lousa
f1d14bf4b8
fix: node minimize/expand functionality and regression tests (#5579)
* ♻️ (nodeToolbarComponent/index.tsx): refactor handleSelectChange function to improve readability and maintainability by extracting switch cases into separate functions and adding dependencies to useCallback for better performance.

*  (GenericNode/index.tsx): Add data-testid attribute to improve testing capabilities for showing/hiding node content
 (general-bugs-minimize-state-error.spec.ts): Add test case to ensure user can minimize and expand a node multiple times without errors

* 📝 (nodeToolbarComponent/index.tsx): Remove unnecessary dataTestId prop from SelectItem component
📝 (types/components/index.ts): Change dataTestId prop in toolbarSelectItemProps to be optional by adding a question mark (?)

* 📝 (general-bugs-minimize-state-error.spec.ts): refactor test case to use a reusable function for toggling node state between minimize and expand actions. This improves code readability and reduces duplication in the test script.
2025-01-08 17:19:40 +00:00
Cristhian Zanforlin Lousa
b1d09eaebd
feat: Add DataFrame color mapping and rose variables (#5587)
📝 (index.css): add new color variables for datatype rose and its foreground to improve design consistency
📝 (styleUtils.ts): add DataFrame color to nodeColorsName object for better visualization of dataframes in the frontend
2025-01-08 17:19:15 +00:00
Kuba
294de475c1
chore: Use expose instead of ports in docker compose example (#5592)
This makes the postgres instance only reachable from the langflow container and allows it to spin up even if another process (e.g. another postgres instance) is running on the host and binds to the same port.
2025-01-08 16:43:14 +00:00
Lucas Oliveira
723a31051e
feat: add ctrl+shift+z alternative shortcut for redoing actions (#5536)
* Added alternative for redo

* Added redo alternative on hotkeys

* added redo alternative type

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-08 16:03:46 +00:00
Christophe Bornet
6b0435906f
feat: Add support for loading flows and components from URLs (#5020)
* Add support for loading flows and components from a zip

* Translate github URLs automatically
2025-01-08 15:31:20 +00:00
Ítalo Johnny
93d5a22c56
fix: adjust path to run only unit tests (#5184)
* fix: adjust path to run only unit tests

* style: split unit test command for readability
2025-01-08 13:40:08 +00:00
Gabriel Luiz Freitas Almeida
8809128d93
tests: fix tests by clearing service_manager services (#5573)
* refactor(tests): add new fixtures to files tests

- Introduced new pytest fixtures for creating API keys, active users, and flows to streamline test setup.
- Updated file upload, download, list, and delete tests to utilize the new fixtures, improving clarity and maintainability.
- Ensured that flow IDs are correctly referenced in all file operations, enhancing test accuracy.
- Added cleanup logic in fixtures to maintain database integrity after tests.

This refactor improves the organization of test cases and ensures that they are more robust and easier to understand.

* fix(tests): clear services cache in test fixtures

- Added logic to clear the services cache in both `conftest.py` and `test_files.py` fixtures to ensure a clean state for tests.
- This change prevents potential interference between tests by resetting the service manager's factories and services before each test run.

* refactor(tests): streamline file upload tests and remove unused mocks

- Removed the mock implementation of StorageService from the test fixtures to simplify the test setup.
- Introduced new fixtures to set maximum file size upload limits, enhancing test flexibility.
- Updated file upload, download, and list tests to directly use the new fixtures, improving clarity and maintainability.
- Ensured that uploaded file content is accurately tested, reflecting changes in the upload and download logic.
2025-01-08 13:13:41 +00:00
Cristhian Zanforlin Lousa
f080049526
fix: add tests and adjustments to Chroma component (#5571)
* Refactor: Update EditNodeComponent to hide table options and block hide

* 🐛 (model.py): fix issue with search_documents method not returning empty list when search_query is empty
♻️ (model.py): refactor search_documents method to handle search_query logic more efficiently
📝 (chroma.py): add typing_extensions override import for build_vector_store method to improve code readability

*  (tests): add unit tests for ChromaVectorStoreComponent

- Introduced new test suite for ChromaVectorStoreComponent, covering various functionalities including database creation, collection management, similarity and MMR searches, and duplicate handling.
- Implemented tests for creating collections with and without data, ensuring proper functionality and data integrity.
- Verified search capabilities with different query types and result limits, enhancing overall test coverage for the component.

* fix: remove unnecessary whitespace in model.py and add missing import in chroma.py

* fix: mypy error module has no attribute "timeout"

* ♻️ (async_helpers.py): Remove unnecessary type hint ignore comment from timeout_context function

* 📝 (async_helpers.py): add a comment with issue reference PGH003 to document the reason for ignoring type checking in timeout_context function

* ♻️ (async_helpers.py): Remove unnecessary type hint comment to improve code readability and maintainability

* ♻️ (async_helpers.py): Add type ignore comment to suppress miscellaneous type error for timeout_context function

* ♻️ (async_helpers.py): refactor timeout_context function to remove unnecessary type ignore comments and improve code readability

* [autofix.ci] apply automated fixes

* 📝 (async_helpers.py): add a blank line for better code readability and consistency

* fix: mypy error: incompatible redefinition

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-08 13:01:39 +00:00
Raphael Valdetaro
cfaac694dc
refactor: Update WikidataAPI component to standard output pattern (#5431)
* refactor: Update WikidataAPI component to standard output pattern

* [autofix.ci] apply automated fixes

* Fix formatting errors in wikidata_api.py

* fix: Fix linting error in tools init

* test: add unit tests for WikidataComponent

* refactor: rename WikidataComponent to WikidataAPIComponent

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-01-07 22:22:54 +00:00
anovazzi1
19a18a090c
Fix: update viewBox dimensions in Langwatch component (#5560)
refactor: Update viewBox dimensions in Langwatch component
2025-01-07 16:44:08 +00:00
anovazzi1
f253246714
Refactor: update selectors in outdated message test (#5079)
* fix: add missing imports and update selectors in outdated message test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-07 16:42:03 +00:00
Gabriel Luiz Freitas Almeida
4ea144eba9
refactor: make StructuredOutput tests to use MockLanguageModel (#5563)
* feat: add MockLanguageModel for testing language model interactions

- Introduced a new mock implementation of BaseLanguageModel to facilitate unit testing.
- Implemented methods to simulate responses and handle message processing.
- Added functionality to generate mock responses based on input messages.
- Ensured compatibility with existing language model interfaces for seamless integration in tests.

* refactor: simplify test_structured_output_component by replacing MagicMock with MockLanguageModel

- Removed extensive mock implementations of BaseLanguageModel in tests.
- Replaced instances of MagicMock with a new MockLanguageModel for better clarity and maintainability.
- Streamlined test cases for structured output generation and error handling.
- Ensured compatibility with existing test structure while enhancing readability.

* fix: rename utils.py to useful.py to avoid namespace conflict

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2025-01-07 15:48:16 +00:00
Gabriel Luiz Freitas Almeida
7084433adc
chore: Update supported versions in tests constants (#5569)
* fix(tests): update supported versions in constants.py to include new releases

- Updated SUPPORTED_VERSIONS to reflect the latest versions: 1.0.19, 1.1.0, and 1.1.1.
- This change ensures that tests are aligned with the most current versioning.

* refactor(tests): update file_names_mapping for input, output, and prompt components

- Removed outdated version entries (1.0.15 to 1.0.18) and added new versions (1.1.0 and 1.1.1) for ChatInput, TextInput, ChatOutput, and Prompt components.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.

* fix(tests): update file_names_mapping in TestTextOutputComponent to reflect new versioning

- Removed outdated version entries (1.0.17, 1.0.18) and added new versions (1.1.0, 1.1.1) for TextOutput component.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.
2025-01-07 15:43:49 +00:00
Gabriel Luiz Freitas Almeida
95314e3fca
tests: allow tests to skip version tests if file_names_mapping is empty (#5562)
fix(tests): update ComponentTestBase to skip tests when file_names_mapping is empty

- Modified the test method to skip the test instead of raising an AssertionError when no file names mapping is provided.
- Improved user feedback by providing a clear message indicating the reason for skipping the test.
2025-01-07 12:47:14 +00:00
Cristhian Zanforlin Lousa
af4fb3774e
feat: Revamp GlobalVariableModal (#5512)
* 📝 (GlobalVariableModal.tsx): Refactor GlobalVariableModal component to use Tabs component instead of Select for type selection and improve layout and styling of input fields and labels
🔧 (index.tsx): Add popoverWidth prop to InputComponent to allow setting the width of the popover in CustomInputPopover component
🔧 (index.tsx): Add popoverWidth prop to InputComponent in InputGlobalComponent to set the width of the popover to 315px

 (tabs-button.tsx): introduce new TabsButton component to handle tab functionality in UI components
📝 (tabs-button.tsx): add documentation for Tabs, TabsContent, TabsList, TabsTrigger components
📝 (components/index.ts): add popoverWidth property to InputComponentType to control the width of the popover in UI components

*  (GlobalVariableModal.tsx): Add ForwardedIconComponent to display an icon next to the modal header text for better visual representation
📝 (GlobalVariableModal.tsx): Update TabsTrigger components to include data-testid attribute for testing purposes

 (index.tsx): Introduce new components OptionBadge, CommandItemContent, and SelectionIndicator to improve code organization and reusability
♻️ (index.tsx): Refactor handleRemoveOption function to have a more descriptive parameter signature and improve readability
📝 (index.tsx): Add comments to clarify the purpose of handleOptionSelect function and improve code documentation
📝 (index.tsx): Add comments to describe the purpose of getInputClassName and getAnchorClassName functions for better code understanding

 (globalVariables.spec.ts): improve placeholder text for variable name and value fields for better user understanding and experience

* 🐛 (GlobalVariableModal.tsx): Fix disabled state logic for TabsTrigger components to correctly reflect initialData type
📝 (GlobalVariableModal.tsx): Update label for submit button to dynamically change based on the presence of initialData

* 🐛 (index.tsx): Fix issue where options were not being correctly memoized as a Set to prevent unnecessary re-renders. Update memoizedOptions to correctly memoize options as a Set.

* 📝 (userSettings.spec.ts): Update placeholder text for variable name and value fields to improve clarity and user experience.
2025-01-07 12:07:08 +00:00
anovazzi1
a142b45160
feat: make Agents not send message if not connected to an output component (#5521)
* Refactor: Commented out  TextInput and TextOutput components

* Refactor: Add function to check if graph has output vertex connected to it

* Refactor: Add function to skip messages based on vertex configuration and message type

* Refactor: Update function to check for chat output in graph vertices

* Refactor: Enhance message skipping logic to include vertex existence check

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-06 21:01:09 +00:00
anovazzi1
a57a49d48d
refactor: prevent tool mode on group component (#5522)
* Refactor nodeToolbarComponent to conditionally show tool mode button based on isGroup variable

* add toolModeGroup.spec.ts test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-06 20:20:37 +00:00
Cristhian Zanforlin Lousa
2ed0b10679
fix(nightly): refactor freeze-path feature test (#5557) 2025-01-06 10:59:29 -08:00
Edwin Jose
89756390e8
fix: uv lock fixes issues from crosshair-tool versions (#5535)
Update uv.lock
2025-01-03 19:27:22 +00:00
Mendon Kissling
cd6dfc20e3
fix: remove duplicate Components section from sidebar (#5533) 2025-01-03 17:23:45 +00:00
Lucas Oliveira
a6bebd5fcb
docs: remove Guides, add pages on other categories, add Types (#4881)
* Adds Chat Memory on Components

* Removes Guides

* Adds Types

* Fix links that referenced Guides

* combine-files

* redirects

* content

* fix(docs): update sidebar position and redirect path in configuration files

* feat(docs): update memory components documentation and sidebar links

* feat(docs): enhance configuration documentation with ContentBlock and DataFrame examples

* add-link-for-pydantic-baseclass

* update-links

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-01-03 16:58:29 +00:00
Mendon Kissling
d790761ff0
docs: fix onBrokenAnchor behavior and links (#5520)
* fix: component url errors

* remove-unnecessary-nav-controls

* fix: update link-ids so onBrokenAnchors doesnt throw warnings

* delete unused category files

* delete unused sidebar_position

* space

* docs: format URLs in documentation for consistency

* fix: urls returning 404s

* backtick
2025-01-03 16:30:59 +00:00
Cristhian Zanforlin Lousa
16ff8eb200
feat(model): replace MessageTextInput with MultilineInput for system_message (#5532)
 (model.py): introduce MultilineInput class to handle system messages in LCModelComponent for better organization and readability

📝 (Basic Prompting.json): Update node IDs and edge IDs for better readability and consistency in the JSON file.

📝 (Basic Prompting.json): Update node properties to display a chat message in the Playground instead of generating text using OpenAI LLMs
♻️ (Basic Prompting.json): Refactor field_order and outputs properties for the Chat Output node to include new fields and remove unnecessary ones

 (Basic Prompting.json): Update ChatOutput component to include new inputs and outputs for better customization and functionality. Add support for storing messages, setting sender type, and customizing message appearance.

 (Basic Prompting.json): Update field names and values for better clarity and consistency
♻️ (Basic Prompting.json): Refactor field names and values to improve readability and maintainability

 (Basic Prompting.json): Update the content of the file to include a new class 'OpenAIModelComponent' with inputs for configuring OpenAI model settings and methods for building the model and handling exceptions. Remove the 'data_template' field and update 'input_value' field to 'MessageInput'. Add new fields 'json_mode', 'max_tokens', 'model_kwargs', and 'model_name' with their respective configurations.

📝 (Basic Prompting.json): Update values and descriptions for fields in the Basic Prompting starter project to improve clarity and usability. Add a new field for temperature control with a default value of 0.1.
2025-01-03 14:23:52 +00:00
Gabriel Luiz Freitas Almeida
3e23800199
feat: Implement streaming support and EventManager integration in flow execution (#5460)
* refactor: add create_stream_tokens_event_manager for handling streaming events

* feat: integrate EventManager into run_graph_internal for enhanced event handling

- Added EventManager import and parameter to run_graph_internal function.
- Updated function call to include event_manager for improved event management during graph execution.

* feat: enhance Graph class with event_manager parameter

- Added event_manager parameter to multiple methods in the Graph class to facilitate better event management during graph execution.
- Updated process and run methods to include event_manager, ensuring it is passed through to relevant function calls.
- Improved documentation for methods to reflect the new event_manager parameter.

* feat: implement streaming support in flow execution with EventManager integration

- Added support for streaming responses in the simplified_run_flow endpoint, allowing real-time event handling during flow execution.
- Introduced consume_and_yield and run_flow_generator functions to manage event consumption and client communication.
- Integrated EventManager for enhanced event tracking, including success and error notifications.
- Updated endpoint documentation to reflect new streaming capabilities and parameters.
- Improved error handling and logging for better debugging and client disconnection management.

* refactor: remove request logging from simplified_run_flow endpoint

- Removed the logging of the request object in the simplified_run_flow function to streamline logging and reduce verbosity.
- This change enhances the clarity of logs by focusing on essential information during flow execution.
2025-01-03 14:21:14 +00:00
Sebastián Estévez
63d649b0f4
feat: add anthropic mcp endpoint (#5148)
* mcp WIP

* [autofix.ci] apply automated fixes

* logging and flow user check

* mcp stdio client component

* handle disconnect better

* initialization

* session fix and type fix

* [autofix.ci] apply automated fixes

* defensive against mcp server bugs

* [autofix.ci] apply automated fixes

* notifications and sse component

* enabled flags and resource support

* remove unneeded print

* extract json schema util

* [autofix.ci] apply automated fixes

* ruff

* fix tools [] bug and db asysnc session api change

* Tool instead of StructuredTool

* ruff fixes

* ruff

* validation optimization

* fix frontend test

* another playwright fix

* Update src/frontend/tests/extended/features/notifications.spec.ts

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

* mcp component descriptions

* mypy fixes

* fix setup_database_url test

---------

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-01-03 04:45:54 +00:00
Mendon Kissling
ee19feaf39
docs: add components-processing link to sidebar and update documentation link in component (#5526)
feat: add components-processing link to sidebar and update documentation URL for RecursiveCharacterTextSplitter
2025-01-02 22:04:37 +00:00
Rodrigo Nader
70eaacfd36
feat: improve gitloader component (#5351)
* feat: improve gitloader component

* [autofix.ci] apply automated fixes

* feat(git.py): refactor GitLoaderComponent to support asynchronous operations and improve temporary directory management

- Convert methods to async to enhance performance with file operations.
- Implement async context manager for handling temporary clone directories.
- Update binary file check and content filtering to be asynchronous.

* fix(git.py): enhance GitLoaderComponent with improved file filtering and binary check

- Refactor file filtering logic to utilize fnmatch for pattern matching.
- Introduce a new method to check for binary files based on null byte detection.
- Update content filtering to handle exceptions more gracefully.
- Modify temporary directory cleanup to use rmdir instead of remove for better directory management.
- Adjust load_documents method to utilize asyncio.to_thread for lazy loading of documents.

* refactor(git.py): enhance GitLoaderComponent with improved file filtering and binary check

- Refactor binary file check to be synchronous and handle exceptions more gracefully.
- Introduce new methods for checking file patterns and content patterns, allowing for more flexible filtering.
- Consolidate filtering logic into a single method for better maintainability.
- Update load_documents method to run lazy loading in a separate thread for improved performance.

* feat(tests): add unit tests for GitLoaderComponent file filtering and binary detection

- Introduced new test suite for GitLoaderComponent, including tests for binary file detection and file pattern matching.
- Implemented temporary file creation for testing various file types and permissions.
- Added tests for combined filtering functionality, ensuring robust handling of file and content patterns.

* refactor(git.py): improve pattern handling and content filtering in GitLoaderComponent

- Refactored pattern handling to use a more descriptive variable name `pattern_list` for clarity.
- Enhanced content filtering by ensuring proper encoding when reading file content.
- Updated regex validation to include a test string check for better error handling.
- Removed unnecessary comments to streamline the code and improve readability.

* fix: exception TypeError

TypeError: object async_generator can't be used in 'await' expression

---------

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: italojohnny <italojohnnydosanjos@gmail.com>
2025-01-02 16:39:16 +00:00
Gabriel Luiz Freitas Almeida
8ea4405010
refactor: run upgrade in dockerfiles to update dependencies (#5508)
chore: Update Dockerfiles to use COPY instead of ADD run apt-get upgrade

- Replaced ADD commands with COPY for better clarity and consistency across Dockerfiles.
- Added apt-get upgrade and clean commands to reduce image size and ensure packages are up to date.
- Updated user creation commands to include necessary cleanup steps.
- Ensured all Dockerfiles follow a similar structure for maintainability.
2025-01-02 15:49:41 +00:00
Gabriel Luiz Freitas Almeida
6c3cde8973
chore: Add manual trigger for Docker test workflow (#5509)
chore: Add workflow_dispatch trigger to docker_test.yml for manual workflow execution
2025-01-02 13:11:33 +00:00
anovazzi1
bf7d089847
Refactor: Remove unused API functions (#5488)
* refactor: Remove unused api functions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-01 03:37:13 +00:00
Ítalo Johnny
c55edcd97f
fix: resolve data keyword conflict in template formatting (#5483)
* fix: resolve data keyword conflict in template formatting

* refactor: simplify code

* test: add unit tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-31 13:13:31 +00:00
anovazzi1
52b2913abe
fix: Update dimensions of SvgLangwatch component (#5424)
refactor: update dimensions of SvgLangwatch component
2024-12-30 20:48:08 +00:00
Madhavan
6263c93684
docs: Improve developer docs with minor changes (#5417)
Improve developer docs with minor changes
2024-12-30 20:22:38 +00:00
Cristhian Zanforlin Lousa
eb120c116e
feat: enhance UX with clickable items and simplified structure (#5387)
🔧 (dropdownComponent/index.tsx): refactor dropdownComponent to improve code readability and remove unnecessary ShadTooltip component
2024-12-30 19:39:14 +00:00
Christophe Bornet
870aedf74e
fix: Fix parallel execution of alembic with SQlite (#5404)
Fix parallel execution of alembic with SQlite
2024-12-30 18:10:33 +00:00
Rogério Chaves
2ce33d41a8
fix(LangWatch): make current trace available for custom code to hook on to, allow to override input/output, fix icon (#5484)
* Call __enter__ to make current langwatch trace available globally so users can more easily add more context to it, like final input and output. This means also skipping setting the root_span input and output if already set

* Update LangWatch logo
2024-12-30 17:59:01 +00:00