Commit graph

15,019 commits

Author SHA1 Message Date
anovazzi1
dbd2bd9375
fix: update LANGFLOW_COMPONENTS_PATH env variable behavior (#5700)
* Refactor directory_reader.py to simplify file filtering logic

* Refactor flowSidebarComponent to filter out bundles and custom components in CategoryGroup

* [autofix.ci] apply automated fixes

* refactor: Improve file filtering in DirectoryReader

This commit improves the file filtering logic in the DirectoryReader class. Previously, it only excluded files that started with "__" and included all files that were not in a "deactivated" directory. Now, it also considers the depth of the file relative to the safe path. Only files that are one or two levels deep are included in the file list.

---------

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-21 01:47:19 +00:00
Ítalo Johnny
f34ba4cd95
fix: preserve template values in custom component updates (#5821)
* fix: preserve template values in custom component updates

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-21 01:28:13 +00:00
Ítalo Johnny
00dcef2bf1
feat: implement function to truncate json (#5811)
* feat: implement function to truncate json

* refactor: apply JSON truncation function in models

* fix: update code to use the standard field serialization format

* Update src/backend/base/langflow/services/database/models/transactions/model.py

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

* Update src/backend/base/langflow/services/database/models/transactions/model.py

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

* Update src/backend/base/langflow/services/database/models/vertex_builds/model.py

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 21:15:07 +00:00
Cristhian Zanforlin Lousa
44266f593b
feat: update starter projects templates (#5819)
update starter projects templates
2025-01-20 21:10:15 +00:00
Lucas Oliveira
d4b9a3f15b
fix: change border color on chat input when active (#5814)
Fixed border color on chat input
2025-01-20 20:58:25 +00:00
Cristhian Zanforlin Lousa
9dc6c24180
feat: change Text to Message type with backend and frontend support (#5652)
*  (inputs.py): Update default prompt input types to include "MessageTextInput" for improved user experience
📝 (styleUtils.ts): Add color definition for "MessageTextInput" node to enhance visual representation in the frontend

* 📝 (text.py): Update input_types for "Value" to include "Message" for better clarity
📝 (memory.py): Update input_types for "Session ID" to include "Message" for consistency
📝 (message.py): Update input_types for "Session ID" to include "Message" for uniformity
📝 (self_query.py): Update input_types for "Query" to only include "Message" for consistency
📝 (create_data.py): Update input_types for fields to only include "Message" for consistency
📝 (update_data.py): Update input_types for fields to only include "Message" for consistency
📝 (inputs.py): Update DEFAULT_PROMPT_INTUT_TYPES to only include "Message" for consistency
📝 (styleUtils.ts): Remove "MessageTextInput" from nodeColors and nodeColorsName for consistency

* 📝 (model.py): update display name from "Text" to "Message" for better clarity
📝 (url.py): update display name from "Text" to "Message" for better consistency
📝 (memory.py): update display name from "Text" to "Message" for better understanding
📝 (text.py): update display name from "Text" to "Message" for better semantics
📝 (llm_math.py): update display name from "Text" to "Message" for improved readability
📝 (runnable_executor.py): update display name from "Text" to "Message" for better context
📝 (sql_generator.py): update display name from "Text" to "Message" for clearer communication
📝 (text.py): update display name from "Text" to "Message" for better consistency
📝 (parse_data.py): update display name from "Text" to "Message" for enhanced understanding
📝 (wikidata_api.py): update display name from "Text" to "Message" for improved semantics
📝 (test_cycles.py): update display name from "Text" to "Message" for better clarity

* [autofix.ci] apply automated fixes

* 🔧 (App.css): change width property value to fit-content to improve layout responsiveness

* fix: resolve merge conflicts and clean up URLComponent implementation in starter projects

- Removed conflicting sections in the JSON files for 'Custom Component Maker' and 'Graph Vector Store RAG'.
- Ensured the URLComponent class is correctly defined with methods for URL validation and content fetching.
- Updated input and output definitions for better clarity and functionality.

* 🐛 (freeze.spec.ts): fix incorrect test selectors for handle-textinput-shownode and handle-parsedata-shownode elements to match updated element IDs

* 📝 (NodeOutputfield/index.tsx): Add id prop to InspectButton component for better identification
🔧 (freeze-path.spec.ts, freeze.spec.ts, stop-building.spec.ts, decisionFlow.spec.ts, similarity.spec.ts, textInputOutput.spec.ts, generalBugs-shard-5.spec.ts, fileUploadComponent.spec.ts): Update test selectors to match changes in UI components for better test accuracy

*  (duckduckgo.spec.ts): update the test to click on a specific element with the test ID "output-inspection-data-duckduckgosearch" instead of "output-inspection-data" to match the updated frontend implementation.

*  (youtube-transcripts.spec.ts): update selector for clicking on transcript element to match changes in the frontend code, ensuring the test remains accurate

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 20:36:46 +00:00
Cristhian Zanforlin Lousa
160452673c
feat: update duckduckgo search component version (#5818)
⬆️ (pyproject.toml): upgrade duckduckgo_search dependency from version 6.3.7 to 7.2.1 for bug fixes and new features
♻️ (duck_duck_go_search_run.py): refactor DuckDuckGoSearchComponent by removing unnecessary 'required' attribute from MessageTextInput
2025-01-20 20:06:12 +00:00
Lucas Oliveira
9104770591
fix: removed refresh table when pagination is off (#5813)
Fixed refresh appearing when pagination is off

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 20:05:09 +00:00
Edwin Jose
03c5b31b71
fix: solves agents auto refresh models setting real_time_refresh False (#5810)
* Update model_input_constants.py

* Update anthropic.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 19:52:26 +00:00
Cristhian Zanforlin Lousa
d9a52d5cb8
feat: Enhance FlowMenu name editing experience (#5729)
*  (FlowMenu/index.tsx): improve user experience by enhancing the flow name editing functionality in the appHeaderComponent's FlowMenu component

*  (FlowMenu/index.tsx): add data-testid attribute to span element for flow name in MenuBar component
🐛 (edit-flow-name.spec.ts): fix test cases to use correct data-testid value for input element in edit-flow-name feature

*  (store-shard-2.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (edit-flow-name.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (flowSettings.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (general-bugs-move-flow-from-folder.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability

*  (FlowMenu/index.tsx): add useEffect hook to set flow name when currentFlow is present and not editing name

* fix errors

*  (youtube-transcripts.spec.ts): update timeout values for page.waitForSelector to improve test performance and reliability

*  (sliderComponent): Add cn utility function to improve classnames handling in SliderComponent
📝 (floatComponent.spec.ts): Update test descriptions and values for NVIDIA related components
♻️ (sliderComponent.spec.ts): Refactor code to replace FloatInput with SliderInput and update import statements and values for temperature slider

*  (youtube-transcripts.spec.ts): skip the test for youtube transcripts component to prevent it from running during test suite execution
2025-01-20 19:41:49 +00:00
Raphael Valdetaro
94d192ff5d
feat: Introduced YouTube bundle with essential components (#5415)
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: anovazzi1 <otavio2204@gmail.com>
2025-01-20 10:49:54 -08:00
anovazzi1
bde5fea4af
refactor: Remove "commands" field from TOOL_TABLE_SCHEMA (#5809) 2025-01-20 17:23:27 +00:00
Edwin Jose
bbb3987cda
feat: Add model filtering support for Ollama Component, improving stability (#5748)
* Update ollama.py

* ollama models refactor

* ollama embeddings support for model filters

* formatting

* Update src/backend/base/langflow/components/embeddings/ollama.py

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

* [autofix.ci] apply automated fixes

* fix test

* reverting test

* refactor: Update Ollama components to use async URL validation

- Changed `is_valid_ollama_url` method to be asynchronous in both `ollama.py` files.
- Updated calls to `is_valid_ollama_url` to use `await` for proper async handling.
- Modified URL validation logic to ensure compatibility with async operations.
- Improved overall responsiveness of the Ollama components by leveraging async HTTP requests.

* reverting to empty list!

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 17:00:40 +00:00
Gabriel Luiz Freitas Almeida
3b8578ca8c
feat: Add MAX_ITEMS_LENGTH constant and implement list truncation in ResultDataResponse (#5807)
* feat: add MAX_ITEMS_LENGTH constant and implement list truncation in ResultDataResponse

- Introduced a new constant MAX_ITEMS_LENGTH set to 1000 in constants.py.
- Updated ResultDataResponse in schemas.py to truncate lists exceeding MAX_ITEMS_LENGTH, appending a message indicating the number of truncated items.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 16:53:11 +00:00
Gabriel Luiz Freitas Almeida
25ca57f53f
tests: Remove unnecessary benchmark markers from server init tests (#5806)
refactor(tests): remove benchmark markers from server init tests

- Removed unnecessary @pytest.mark.benchmark decorators from multiple performance test functions in test_server_init.py.
- This change streamlines the test suite by eliminating redundant benchmarking annotations, while maintaining the integrity of the tests.
2025-01-20 16:43:46 +00:00
VICTOR CORREA GOMES
420cd92faa
feat(component): API Request Component Overhaul (#5007)
* style: Add icon property to WebhookComponent class

* style: Update input components in APIRequest class

* fix pr

* [autofix.ci] apply automated fixes

* remove debug print statement from api_request component

* remove debug print statement from api_request component

* feat: add dynamic cURL mode to APIRequestComponent

- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle

* refactor(APIRequestComponent): improve HTTP methods and cURL handling

- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests

* style: Update input components in APIRequest class

* [autofix.ci] apply automated fixes

* remove debug print statement from api_request component

* remove debug print statement from api_request component

* feat: add dynamic cURL mode to APIRequestComponent

- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle

* refactor(APIRequestComponent): improve HTTP methods and cURL handling

- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests

* [autofix.ci] apply automated fixes

* git commit -m "ui(api-request): adjust field visibility and requirements

- Move query_params to advanced section
- Make URL field required"

* feat(api): enhance curl parsing and update unit tests

- Improve MultilineInput handling in APIRequestComponent for curl commands
- Update parse_curl unit test to match expected data structure
- Ensure consistent format for headers and body in test assertions

* [autofix.ci] apply automated fixes

* fix(api-request): improve UI/UX and fix initial field visibility

- Fix body field flickering on component load
- Enhance URL/cURL field toggle behavior

*  (filterSidebar.spec.ts): add tests for clicking on edit button modal, show headers button, and closing the modal to ensure correct behavior and visibility of elements

* 📝 (dictComponent/index.tsx): update data-testid attribute to dynamically set based on editNode value for better testability
📝 (nestedComponent.spec.ts): update test data and selectors to match changes in dictComponent/index.tsx for accurate testing

* refactor(api_request): improve component UX and field handling

- Update tool_mode placement to align with main branch changes
- Remove temporary required field validation to prevent UI conflicts
- Add field clearing logic when switching between cURL and URL modes
- Update component description to be more concise

* git commit -m "fix: resolve merge conflicts with upstream in api request component

* fix: resolve merge conflicts with upstream in api request component

* Delete src/backend/tests/unit/test_data_components.py

BREAKING CHANGE: Removed test_data_components.py as it has been replaced by test_api_request_component.py

* git commit -m "test(api-request): update test_parse_curl to match TableInput format

* style(test_api-request): apply ruff formatting rules

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-20 16:23:59 +00:00
anovazzi1
0cf4f03400
fix: Improve error handling in aupdate_messages function to prevent empty message error (#5655)
* refactor: Improve error handling in aupdate_messages function

* Update src/backend/base/langflow/memory.py

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

* fix(tests): updating a non-existing message adds a new message now

- Updated the test name from `test_aupdate_nonexistent_message` to `test_aupdate_nonexistent_message_generates_a_new_message` for better clarity.
- Modified the assertion to expect that a new message is generated when attempting to update a nonexistent message, changing the expected length of the updated messages from 0 to 1.

* [autofix.ci] apply automated fixes

* fix(tests): update message handling in tests for non-existent messages

- Refactored tests to ensure that attempting to update a non-existent message raises a ValueError instead of creating a new message.
- Updated test names and assertions for clarity and accuracy, ensuring they reflect the expected behavior when handling messages that do not exist in the database.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 16:21:19 +00:00
Cristhian Zanforlin Lousa
00deb49c67
fix: Add optional chaining for getSelectedRows in TableComponent (#5805)
🐛 (tableComponent/index.tsx): fix potential null pointer exception when getting selected rows length
2025-01-20 16:14:45 +00:00
github-actions[bot]
b0325ef2af
chore: update test durations (#5799)
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 15:54:25 +00:00
Raphael Valdetaro
a9559515e5
refactor: Search API component ensuring standard output pattern (#5435)
* refactor: Update Search API component to standard output pattern

* fix: rename component class to avoid conflict with legacy version

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* fix: address performance regression

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
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: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2025-01-20 15:43:22 +00:00
Owein
2dffc5dfd3
feat: add more search parameters to google_serper_api component (#4944)
* feat: add more search parameters to google_serper_api component

* [autofix.ci] apply automated fixes

* fix: change default value of query_params to None in GoogleSerperAPIComponent

* [autofix.ci] apply automated fixes

* fix: update query_params type to Optional

* [autofix.ci] apply automated fixes

* fix: move QuerySchema definition outside the Component

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/components/tools/google_serper_api.py

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

* fix: format code for better readability in google_serper_api.py

* [autofix.ci] apply automated fixes

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

---------

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-20 15:38:56 +00:00
Raphael Valdetaro
06139ef2df
refactor(yahoo-finance): Refactor Yahoo Finance API component to support tool mode (#5434)
* refactor(yahoo-finance): Refactor Yahoo Finance API component

* fix(yahoo-finance): Revert method input changes and fix enum error

* fix: update yfinance tool test and remove duplicate method

* fix: rename component class to avoid conflict with legacy version

* [autofix.ci] apply automated fixes

* test: add ToolException import to yfinance tool tests

* [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>
2025-01-20 15:07:37 +00:00
Gabriel Luiz Freitas Almeida
18e21cfec9
fix: make chat input sorting logic exclude other components (#5760)
* fix: Adjust chat input handling in layer sorting logic

* fix: Update chat input sorting logic and assertions in tests

* [autofix.ci] apply automated fixes

* fix: Update test assertion for chat input sorting to reflect changes in expected output

* [autofix.ci] apply automated fixes

* fix: update vertex sorting logic to handle start_component_id condition

- Modified the condition for sorting layers to include a check for start_component_id being None, ensuring correct behavior when this parameter is not set.
- This change improves the accuracy of the vertex sorting process in the graph utility functions.

* fix: update test assertion for vertex IDs in test_get_vertices

- Modified the test assertion in `test_get_vertices` to reflect the expected output, ensuring it only checks for "ChatInput" in the returned IDs.
- This change improves the accuracy of the test by aligning it with the current expected behavior of the endpoint.

* [autofix.ci] apply automated fixes

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

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2025-01-20 13:49:44 +00:00
Anwar Sadat Ayub
feb6907909
docs: corrected typo flowis to flow is (#5695)
fix: correct typo "flowis" to "flow is"

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 13:34:01 +00:00
Cristhian Zanforlin Lousa
5c3c680c41
refactor: Enhance InputList Component UI/UX (#5726)
* [LFOSS-74]: input list UI improvements

*  (frontend): Add new component 'DeleteButtonInputList' to improve user experience by providing a button to delete items in a list
📝 (frontend): Comment out unused code related to duplicating input items for now, to be revisited in a future release
📝 (frontend): Add a comment to indicate that the 'DropdownMenuInputList' feature will be added back in a future release
📝 (frontend): Update CSS styling for 'hit-area-icon' class to adjust size to h-7 and w-7 for consistency
📝 (frontend): Adjust color values in CSS to improve visual appearance, changing smooth-red to a new shade

*  (keypairListComponent/index.tsx): simplify conditional styling logic for list items to improve readability and maintainability

* 📝 (delete-button-input-list.tsx): Remove unused imports and update function parameter type for removeInput to specify React.MouseEvent
📝 (delete-button-input-list.tsx): Update button className and IconComponent className for better styling and readability
📝 (delete-button-input-list.tsx): Update ICON_STROKE_WIDTH constant value from 1.25 to 1.5 for better icon appearance
📝 (index.tsx): Update InputListComponent to render DeleteButtonInputList component conditionally based on value length
📝 (constants.ts): Update ICON_STROKE_WIDTH constant value from 1.25 to 1.5 for better icon appearance
📝 (inputListComponent.spec.ts): Update test cases to use updated test IDs for delete buttons and adjust expected input values to match changes in component behavior

* [autofix.ci] apply automated fixes

* 🔧 (applies.css): adjust positioning of input-slider-text to fix alignment issue and improve user experience

* 🐛 (button-input-list.tsx): fix button position by adjusting translate-x value to align properly on the page

*  (index.tsx): add visual indicator for focused input element in the list to improve user experience

---------

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-20 13:25:55 +00:00
Sujal Bhavsar
317c743906
feat(groq): added llama 3.3 models (#5497)
* Update groq_constants.py

added new llama 3.3 models from groq

* Rechecking the codeflash workflow

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 13:01:19 +00:00
Vini murafa
1afa76a75c
fix: fix typo in CONTRIBUTING.md (#5556)
Fix typo Update CONTRIBUTING.md

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:59:56 +00:00
Gabriel Luiz Freitas Almeida
204b4e10e0
refactor: add utility methods for getting display name and improve error messages (#5653)
* feat: add methods to access inputs' and outputs' display_name

- Updated error messages to use display names for inputs and outputs, improving clarity.
- Introduced utility methods for building consistent error messages related to inputs, outputs, and components.
- Added public methods to retrieve user-friendly display names for inputs and outputs.
- Refactored existing error handling to utilize the new messaging methods for better maintainability.

* refactor: enhance error message formatting for inputs, outputs, and components

- Updated error message formatting to place input, output, and component names at the beginning for better visibility, especially when messages are truncated.
- Changed the format of error messages to use square brackets for consistency and improved readability.
- Ensured that utility methods for building error messages maintain a user-friendly approach.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 12:53:31 +00:00
Jason
84c6ed2217
feat: add new model provider Novita AI (#5380)
* feat: add new model provider Novita AI

* [autofix.ci] apply automated fixes

* fix: code format fix

* fix: code format fix

* fix: fix default Novita AI models

* [autofix.ci] apply automated fixes

* feat: Add real-time refresh for Novita API key and include it in VARIABLES_TO_GET_FROM_ENVIRONMENT

---------

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-20 12:53:28 +00:00
dhlidongming
6b02ef0a70
fix: initial hidden state for shadow-box component (#5639)
* Ensure shadow-box starts hidden on initial render.

* add comment to explain not obvious style fix

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:52:30 +00:00
Hack666r
e00ee88e06
fix: fix typo Update DEVELOPMENT.md (#5558)
Fix typo Update DEVELOPMENT.md

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:43:29 +00:00
github-actions[bot]
a800778f70
chore: update test durations (#5790)
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:33:45 +00:00
anovazzi1
8b7cbba206
fix: Adjust size of LMStudioIcon component (#5763)
refactor: Adjust size of LMStudioIcon component

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:31:39 +00:00
Cristhian Zanforlin Lousa
4d8e050f40
feat: Add output dimensionality validation for Google AI embeddings (#5758)
* 🐛 (google_generative_ai.py): add input validation to ensure output dimensionality is within valid range

* [autofix.ci] apply automated fixes

* 🐛 (google_generative_ai.py): refactor code to use constants for min and max output dimensionality values to improve readability and maintainability

* [autofix.ci] apply automated fixes

* 📝 (google_generative_ai.py): remove unnecessary error message detail about received dimensionality, as it is not relevant for users and does not affect functionality

* [autofix.ci] apply automated fixes

* 🐛 (google_generative_ai.py): enhance output dimensionality validation by ensuring checks only occur when output_dimensionality is not None

---------

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-20 12:22:35 +00:00
Edwin Jose
d9d9cbb345
fix: tool name in component toolkit if the name of the component is None (#5761)
* Update component_tool.py

* formatting

* Update src/backend/base/langflow/base/tools/component_tool.py

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

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:07:33 +00:00
Gabriel Luiz Freitas Almeida
45f2bebc31
fix: change telemetry logging level from exception to error (#5804)
fix: change telemetry logging from exception to error level
2025-01-20 12:00:16 +00:00
Nguyễn Hưng
bf57f058c7
fix: correct issue with change api key to be of type str (#5716)
* change api key to be of type str

* change SecretStr type to new way import

* revert package-lock changes

- Removed license information from several dependencies in package-lock.json for cleaner output.
- Updated versions of various dependencies, including @babel packages and chakra-ui components, to their latest compatible versions.
- Ensured consistency in dependency versions across the project to maintain stability and compatibility.

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 11:57:47 +00:00
VICTOR CORREA GOMES
6c79a3d6aa
refactor(tools): overhaul Python REPL component with modern tool mode (#5463)
* refactor(tools): overhaul Python REPL component with modern tool mode

BREAKING CHANGE: Complete redesign of PythonREPL component architecture

- Replace legacy tool mode with modern tool_mode=true implementation
- Add automatic import detection for both global and from-imports
- Remove manual global_imports field in favor of automatic detection
- Implement CodeInput type support with FieldTypes.CODE
- Update schema to handle new parameters for agent compatibility
- Improve error handling and logging for import failures

The component now automatically handles imports without manual configuration,
supports modern tool mode, and provides better integration with the agent
system through updated schema definitions.

* refactor(python-repl): remove name parameter

* feat(security): add required global imports validation

- Add explicit global imports input for security control
- Set both global_imports and python_code as required fields
- Remove AST-based import analysis in favor of explicit imports

* [autofix.ci] apply automated fixes

* fix: remove generic exception handling in python_repl

Removed overly broad exception handling to comply with linting rules.

* fix

* test(python-repl): update component test to match current implementation

- Remove assertions for deprecated outputs (api_run_model, api_build_tool)
- Add assertions for current 'results' output
- Add detailed input validation tests for global_imports and python_code
- Verify input configurations including type, default values, and required status
- Ensure component template structure matches frontend requirements

This change aligns the test suite with the current PythonREPLToolComponent
implementation, improving test coverage and maintaining component reliability.

* revert(tools): restore Python REPL component to original implementation

Due to backward compatibility concerns, reverting the Python REPL component
to its initial implementation state to maintain stability and prevent breaking changes.

* feat(tools): mark Python REPL component as deprecated & Legacy

* feat(tools): add Python REPL Core component

* [autofix.ci] apply automated fixes

* fix(tests): mark Python REPL Core as unreleased component

* fix(__init__): fix

* feat(python-repl): improve example clarity for printing the results

* fix(tests): resolve KeyError in test_component_versions

* style(python-repl): format description string to follow PEP 8 guidelines

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-20 11:54:32 +00:00
Gabriel Luiz Freitas Almeida
918159f3ce
fix: update datetime serialization to include timezone information (#5795)
* fix: update datetime serialization to include timezone information

* fix: improve datetime serialization to use 'utc_date' for clarity
2025-01-20 11:51:49 +00:00
Ítalo Johnny
c8eb408b5e
feat: preserve manual component data if code unchanged (#5482)
* chore: preserve manual component data if code unchanged

* Fixed tool mode switch not changing with code

* Removed console.log

* Made tool mode not be lost when mutating template

* use setNode instead of setNodes on component code

* refactor: tool_mode return

* Fix tool mode being reverted on toggle

* fix: tool_mode outputs return

* change: logic for setting `tool_mode`

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 11:34:52 +00:00
Phil Nash
c1cec32d9e
feat: use all available time zone names in CurrentDateComponent (#5797)
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-20 07:46:30 +00:00
Raphael Valdetaro
7f6b924f9c
refactor: Update Serp API component to standard output pattern (#5437)
* refactor: Update Serp API component to standard output pattern

* test: add unit tests for SerpAPIComponent

* [autofix.ci] apply automated fixes

* fix: rename component class to avoid conflict with legacy version

* [autofix.ci] apply automated fixes

* fix: update SerpAPI to extend LCToolComponent

* [autofix.ci] apply automated fixes

* deprecate: mark SerpAPIComponent as legacy and deprecated

* refactor: update Serp API component tests to use new SerpComponent

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-20 07:17:43 +00:00
Cristhian Zanforlin Lousa
6ac45a8638
feat: enhance environment variable support and update settings configuration (#5766)
*  (langflow/__main__.py): Add logic to dynamically update auth settings based on environment variables prefixed with "LANGFLOW_"
♻️ (auth.py): Refactor AuthSettings class to use model_config attribute for configuration settings instead of Config class

*  (langflow/__main__.py): dynamically load environment variables prefixed with "LANGFLOW_" into settings_service.settings for improved configuration flexibility

* [autofix.ci] apply automated fixes

* formatting code

* [autofix.ci] apply automated fixes

* ♻️ (langflow/__main__.py): refactor code to remove redundant loop that sets settings from environment variables

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2025-01-20 06:03:29 +00:00
Ítalo Johnny
d413abbf90
refactor: enhance graph initialization and telemetry handling (#5721)
* refactor: asyncdbsession handling in event_generator

* refactor: simplify graph building logic in build_flow

* refactor: simplify graph initialization and sorting

* refactor: adjust graph initialization and telemetry
2025-01-20 01:25:54 +00:00
Ítalo Johnny
f22cf01d5c
ci: adds verbosity to the backend unit tests output (#5775) 2025-01-19 23:21:24 +00:00
Gabriel Luiz Freitas Almeida
69dc96039e
feat: limit transaction and vertex build logging with retention policies (#5658)
* feat: implement vertex build logging with maximum retention policy

- Added functionality to log vertex builds while maintaining a maximum number of builds per vertex.
- Introduced a new setting `max_vertex_builds_per_vertex` to configure the retention limit.
- Updated `log_vertex_build` method to delete older entries in a single transaction if the limit is exceeded.
- Enhanced error handling to ensure database integrity during logging operations.

* feat: enhance transaction logging with maximum retention policy

- Implemented functionality to log transactions while maintaining a maximum limit on the number of transactions stored in the database.
- Introduced logic to delete older transactions when the limit is exceeded, ensuring efficient database management.
- Enhanced error handling to maintain database integrity during transaction logging operations.

* feat: enhance vertex build logging with global and per-vertex retention policy

- Updated the log_vertex_build function to maintain a maximum number of vertex builds globally and per vertex.
- Introduced new settings for global maximum builds to keep and per-vertex maximum builds.
- Implemented logic to delete older entries both globally and per vertex in a single transaction, ensuring efficient database management.

* fix: import dependency

* fix: update max_vertex_builds_per_vertex setting to improve build retention policy

- Changed the maximum number of builds per vertex from 5 to 2 to enhance resource management.
- This adjustment aims to optimize database storage and ensure older builds are deleted more efficiently.

* fix: ensure flow_id is a UUID in get_vertex_builds_by_flow_id function

- Added a check to convert flow_id from string to UUID if necessary, improving type safety and preventing potential errors during database queries.

* feat: add test for multiple flow builds and vertex build verification

- Implemented a new asynchronous test to validate that multiple builds of a flow generate the expected number of vertex builds.
- The test includes detailed logging of vertex build states and ensures that the number of builds per vertex adheres to the configured maximum.
- Introduced session ID generation for each request to simulate real-world usage and added delays to maintain request order.
- Enhanced verification logic to assert the correctness of build counts and validity after multiple requests.

* refactor: optimize vertex build deletion logic with CTEs

- Replaced the previous deletion logic in the log_vertex_build function with Common Table Expressions (CTEs) for improved clarity and performance.
- Introduced global and per-vertex ranking CTEs to streamline the process of identifying and deleting older vertex builds based on configured limits.
- This change enhances the efficiency of the database operations while maintaining the existing retention policies for vertex builds.

* [autofix.ci] apply automated fixes

* fix: remove unnecessary db.refresh call in log_vertex_build function

- Eliminated the redundant await db.refresh(table) line in the log_vertex_build function to streamline the deletion process.
- This change improves the efficiency of the function by reducing unnecessary database operations while maintaining the integrity of the vertex build logging logic.

* Revert "refactor: optimize vertex build deletion logic with CTEs"

This reverts commit d741233e5c3fadd79d91fbe246b005f3855300df.

* feat: enhance vertex build retrieval and logging with detailed documentation and retention policies

- Updated the `get_vertex_builds_by_flow_id` function to include comprehensive docstring documentation, clarifying its purpose, arguments, and return values.
- Refined the `log_vertex_build` function to support configurable maximum builds to keep globally and per vertex, with improved transaction handling and error management.
- Added detailed docstrings for both functions to improve code readability and maintainability.
- Ensured that the function handles string to UUID conversion for `flow_id` seamlessly, enhancing type safety.
- This update aims to improve the clarity of the codebase and ensure efficient management of vertex builds in the database.

* feat: add unit tests for vertex build logging and retention policies

- Introduced new test suite for vertex build logging, including tests for basic logging, global and per-vertex limits, integrity error handling, and concurrent logging.
- Implemented fixtures for generating sample vertex build data and mock settings to streamline testing.
- Enhanced tests to verify that the logging mechanism adheres to configured retention policies, ensuring efficient management of vertex builds in the database.
- This addition aims to improve code coverage and ensure the reliability of vertex build functionalities.

* refactor(database): replace direct table column references with col() function for consistency and clarity in query construction

* refactor(database): remove IntegrityError handling in transaction logging functions

- Eliminated the IntegrityError exception handling in the log_transaction and log_vertex_build functions to simplify error management.
- This change streamlines the transaction process by relying on a general exception handler, improving code clarity and maintainability.

* refactor(tests): convert mock_settings fixture to async and utilize asyncio.to_thread for Settings instantiation

- Updated the mock_settings fixture to be asynchronous, improving compatibility with async test cases.
- Replaced direct instantiation of Settings with asyncio.to_thread to ensure non-blocking behavior during tests.
- This change enhances the test suite's performance and aligns with the asynchronous nature of the application.

* refactor(tests): update mock_settings fixture to async for improved test performance

- Converted the mock_settings fixture to an asynchronous function, allowing for better compatibility with async test cases.
- Utilized asyncio.to_thread for the instantiation of Settings, ensuring non-blocking behavior during tests.
- This change enhances the overall performance of the test suite and aligns with the asynchronous architecture of the application.

* fix(tests): correct mock_settings fixture and remove async usage

- Fixed a typo in the import statement for datetime in the test_vertex_builds.py file.
- Changed the mock_settings fixture back to a synchronous function, removing the unnecessary use of asyncio.to_thread for Settings instantiation.
- This update ensures compatibility with the existing test structure while maintaining the intended functionality of the mock settings.

* refactor(tests): streamline vertex build logging test for improved clarity and efficiency

- Consolidated build creation and insertion logic in `test_log_vertex_build_with_different_limits`.
- Enhanced readability by reducing redundancy in build sorting and insertion steps.
- Maintained functionality to ensure limits on total and per-vertex builds are correctly enforced.

This refactor aims to improve the maintainability of the test while ensuring it accurately verifies the logging behavior of vertex builds.

* refactor(tests): comment out failing test for vertex build generation

- Temporarily disable `test_multiple_runs_with_no_payload_generate_max_vertex_builds` due to issues with its execution.
- The test was designed to verify the correct number of vertex builds generated during multiple flow builds but requires further investigation and fixes before re-enabling.

This change aims to maintain test suite stability while addressing underlying issues in the test logic.

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-19 21:24:21 +00:00
Cristhian Zanforlin Lousa
125a1c1ebc
fix: restore template tags and correct names (nightly fix) (#5791) 2025-01-19 12:02:57 -03:00
Gabriel Luiz Freitas Almeida
f5d9d53264
fix: update Tavily component in Instagram Copywriter and Market Research projects and tests (#5789) 2025-01-18 17:07:23 -08:00
Edwin Jose
5b2a7c1df4
fix: tool mode reset for connected components when reloading the flow (#5781)
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-18 15:37:16 -08:00
Gabriel Luiz Freitas Almeida
8459ce99f7
chore: Update starter projects (#5788) 2025-01-18 15:17:44 -08:00