Commit graph

14,999 commits

Author SHA1 Message Date
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
Cristhian Zanforlin Lousa
d8eabc715e
feat: update starter projects with latest component versions (nightly fix) (#5780) 2025-01-18 16:14:36 -03:00
VICTOR CORREA GOMES
d650b21f17
refactor(google_serper_api): migrate to new tool mode implementation (#5446)
* # refactor(google_serper_api): migrate to new tool mode implementation

BREAKING CHANGE: Replace legacy LCToolComponent implementation with new Component base class

- Migrate from LCToolComponent to Component base class
- Add tool_mode flag to MultilineInput
- Update output configuration to use DataFrame type
- Implement structured error handling with DataFrame responses
- Remove legacy tool mode implementation

* test(google-serper): add unit tests for GoogleSerperAPIComponent

- Add comprehensive test suite for GoogleSerperAPIComponent
- Mock HTTP requests to test search functionality
- Test component initialization and configuration
- Add error handling test cases
- Test text search and wrapper building methods
- Ensure proper DataFrame output structure

This change improves test coverage for the Google Serper API integration,
following existing test patterns in the project.

* [autofix.ci] apply automated fixes

* style(tests): remove unused fixture argument in google-serper test

- Remove unused mock_search_results fixture from test_text_search_serper
- Fix linting error ARG001 (unused function argument)

* revert(tools): restore Google Search API component to original implementation

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

* refactor(components): mark GoogleSerperAPI component as deprecated & Legacy

* feat(components): add GoogleSerperAPICore component

* refactor(google-serper): fix filename typo from 'gloogle' to 'google'

* test(google-serper): add unit tests following component test guide

* feat(icons): improve Serper icon quality and add to icon list

* [autofix.ci] apply automated fixes

* Update test_google_serper_api_core.py

test update

---------

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-18 01:25:34 +00:00
Vinícios Batista da Silva
f65d3aa166
refactor: Model input fields of Azure OpenAI component (#5711)
feat: improve model input fields for azure openai component

1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2
3. Add info description to temperature slider
4. Fix code formatting

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-18 00:58:49 +00:00
Vinícios Batista da Silva
d9276fdff2
refactor: Model input fields of Google Generative AI component (#5714)
feat: improve model input fields for google generative ai component

1. Make google_api_key field required
2. Convert temperature to SliderInput with range 0-2
3. Add info description to temperature slider

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-18 00:58:04 +00:00
VICTOR CORREA GOMES
7c04245ea1
refactor(google_search): migrate to new tool mode implementation (#5444)
* ## refactor(google_search): migrate to new tool mode implementation

- Replace legacy tool mode using LCToolComponent with new Component class and tool_mode flag.

- Update input/output definitions to use new DataFrame type and explicit Output configuration.

Key changes:
- Migrate from LCToolComponent to Component base class
- Add explicit output configuration with DataFrame type
- Update error handling to return structured DataFrame responses
- Implement tool_mode using new flag syntax

* test(google-search): add unit tests for GoogleSearchAPIComponent

* fix(google-search): adjust DataFrame format to match expected type

- Update error responses to use list[dict] format instead of dict[list]

* [autofix.ci] apply automated fixes

* revert(tools): restore GoogleSearchAPI component to its original implementation

Due to potential breaking changes in the repository, reverting the GoogleSearchAPI
component to its initial state to maintain compatibility and stability.

* refactor(tools): mark GoogleSearchAPI component as deprecated

Mark GoogleSearchAPI component as legacy and add [DEPRECATED] to its display name
to better communicate its status to users while maintaining backward compatibility.

* feat: add Google Search API core component

Implements Google Search API wrapper with error handling and DataFrame output

* test: update Google Search API tests for core component

Adjusts test file to use GoogleSearchAPICore instead of GoogleSearchAPIComponent

---------

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-18 00:14:38 +00:00
Rodrigo Nader
8d902e6c74
feat: Add ParseDataFrameComponent for DataFrame-to-text conversion with tests (#5594)
* add dataframe outputs to vector stores, directory, url, split text

* [autofix.ci] apply automated fixes

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

* add parse dataframe

* [autofix.ci] apply automated fixes

* Refactor: Update DataFrame handling in components

- Added import of DataFrame in directory and url components.
- Renamed variable 'df' to 'dataframe' in ParseDataFrameComponent for clarity.
- Updated method _clean_args and parse_data to use 'dataframe' instead of 'df' for consistency.

These changes enhance code readability and maintainability by standardizing the terminology used for DataFrame objects.

* [autofix.ci] apply automated fixes

* remove parse dataframe

* feat: add parse dataframe component

* [autofix.ci] apply automated fixes

* Refactor: Remove duplicate as_dataframe method in LCVectorStoreComponent

This commit eliminates the redundant as_dataframe method in the LCVectorStoreComponent class, streamlining the code and improving maintainability. The method was previously defined twice, and this change enhances clarity by ensuring only one implementation exists.

* [autofix.ci] apply automated fixes

* Refactor: Standardize DataFrame variable naming in ParseDataFrameComponent

This commit renames the variable 'df' to 'dataframe' in the ParseDataFrameComponent class to improve clarity and consistency. The changes are reflected in the _clean_args and parse_data methods, enhancing code readability and maintainability.

* test: add unit tests for ParseDataFrameComponent

This commit introduces a comprehensive suite of unit tests for the ParseDataFrameComponent, covering various scenarios including successful parsing with default and custom templates, handling of empty dataframes, invalid template keys, and performance on large dataframes. The tests ensure that the component behaves correctly with different data types and separators, and validate its functionality in both synchronous and asynchronous contexts. These additions enhance the reliability and maintainability of the component.

---------

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: Edwin Jose <edwin.jose@datastax.com>
2025-01-17 23:41:42 +00:00
Edwin Jose
aa5a4a505c
refactor: Deprecate Subflow and Flow as Tool component in favor of RunFlow (#5678)
* depreciated subflow and flow as tool

* 🐛 (filterSidebar.spec.ts): update test cases to reflect changes in sidebar item names by adding [Deprecated] suffix

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-01-17 23:36:41 +00:00
Edwin Jose
040a84ed52
feat: run flow component with tool mode option to run a flow as a tool (#5518)
* Update calculator.py

* Update json_cleaner.py

* [autofix.ci] apply automated fixes

* updated init

* updated format

format

* update component

sample component update

* Update flow_orchestrator.py

* test files

tests

* update in flow Orchestrator

* Update flow_orchestrator.py

solves issues with agents and session ids

* Update flow_orchestrator.py

* update to FlowOrchetstor

update to FlowOrchetstor

* draft Commit

* updated to run_flow

* updates

* refactor code

* [autofix.ci] apply automated fixes

* default_name of tool to be the name of the flow

* add tool_mode default activation

* [autofix.ci] apply automated fixes

* updates to build schema

* [autofix.ci] apply automated fixes

* update to schema and run flow

* cleanup

* Update run_flow.py

* [autofix.ci] apply automated fixes

* fix(run_flow.py): update condition to check if field_order exists in field_template for improved input validation

* Update run_flow.py

* [autofix.ci] apply automated fixes

* debug updates

* updates in flow tool outputs and tool mode

* code cleanup

* Update component_tool.py

* Update run_flow.py

* updated description

added beta tag as per Simons Suggestion

* [autofix.ci] apply automated fixes

* Update component_tool.py

* Update schema.py

* [autofix.ci] apply automated fixes

* feat: Add ToolModeMixin to CodeInput class

* Update component.py

* updated tests

* [autofix.ci] apply automated fixes

---------

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-17 23:12:56 +00:00
Vinícios Batista da Silva
f4a7d9d797
feat: enhance Anthropic component UI and validation (#5690)
* feat: enhance Anthropic component UI and validation

The following improvements were made to the Anthropic component:
- Made API key field required to ensure proper configuration
- Replaced FloatInput with SliderInput for temperature parameter to improve user experience
- Added step control (0.01) for more precise temperature adjustments

Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

* [autofix.ci] apply automated fixes

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

* [autofix.ci] apply automated fixes

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

* fix: make anthropic_api_key required in AnthropicModel component

This change ensures that the Anthropic API key is required for the component to work properly,
preventing potential runtime errors when the key is missing.

Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

* fix: make anthropic_api_key required in AnthropicModel component

This change ensures that the Anthropic API key is required for the component to work properly,
preventing potential runtime errors when the key is missing.

Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

* [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-17 23:00:57 +00:00
Gabriel Luiz Freitas Almeida
a85546f5b2
feat: make NvidiaRerankComponent work with search_results (#5740)
* Renaming data input to 'search results'

Credit: @brian-ogrady

* fix: Update document handling in NvidiaRerankComponent to use new Data model

- Removed the import of Document from langchain.schema.
- Updated the rerank_documents method to utilize the to_lc_document method for converting passages to the new Data model, ensuring type safety and consistency in document processing.

This change enhances the integration with the updated data structures in the project.

* refactor: Remove unused base_retriever output from NvidiaRerankComponent

This change simplifies the output structure of the NvidiaRerankComponent by removing the base_retriever output, which was not being utilized. This refactor enhances code clarity and maintainability.

* refactor: Rename output in NvidiaRerankComponent from 'search_results' to 'reranked_documents'

This change updates the output display name and method in the NvidiaRerankComponent to better reflect its functionality, enhancing clarity in the component's purpose and usage.

* refactor: Remove legacy flag from NvidiaRerankComponent

This change simplifies the NvidiaRerankComponent by removing the unused legacy boolean flag, enhancing code clarity and maintainability.

* refactor: Rename build_model method to build_reranker in NvidiaRerankComponent

This change improves code clarity by renaming the method to better reflect its purpose, aligning with the component's functionality in the reranking process.

* feat: Enable tool mode for search query input in NvidiaRerankComponent

This change adds a new 'tool_mode' flag to the 'search_query' input in the NvidiaRerankComponent, enhancing its functionality and allowing for improved interaction with the component. This update aligns with recent refactors aimed at clarifying the component's purpose and usage.
2025-01-17 22:54:05 +00:00
Raphael Valdetaro
88111c3b34
refactor(component): Convert Tavily Search to standard component pattern (#5430)
* refactor(components): Convert Tavily Search to standard component pattern

* [autofix.ci] apply automated fixes

* fix: improve error handling in tavily component

* fix: Fix linting error in __init__.py

* fix: rename TavilyComponent to TavilySearchToolComponent maintaining backward compatibility

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

---------

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-17 21:13:39 +00:00
VICTOR CORREA GOMES
3474259ca4
refactor: Calculator Component updating tool implementation and fix deprecation warnings (#5442)
* refactor(calculator): update tool implementation

Replace legacy tool mode implementation using CalculatorToolSchema with simplified tool_mode=True approach.

* refactor(calculator): fix deprecation warnings

Fix ast.Num deprecation warnings by supporting ast.Constant while maintaining backwards compatibility.

* Update isinstance check to use Python 3.10+ union operator (|) instead of tuple syntax

* Update calculator.py

Component name required; if not it would get None in Toolset

* [autofix.ci] apply automated fixes

* test(calculator): add unit tests for CalculatorToolComponent

* revert(tools): restore Calculator component to its original implementation

Due to potential breaking changes in the repository, reverting the Calculator
component to its initial PR state to maintain compatibility and stability.

* feat(tools): mark Calculator component as legacy and update display name

- Set legacy flag to true for Calculator component
- Update display name to "Calculator (Deprecated)" to clearly indicate deprecation status
- Maintain backward compatibility by preserving class name and internal name

* feat(tools)!: add new calculator core component

BREAKING CHANGE: Introduces calculator_core.py as a replacement for the deprecated calculator.py

* refactor(tools): rename calculator classes for better distinction

* refactor(tools): update __init__.py to reflect new class names

* [autofix.ci] apply automated fixes

* test(tools): update calculator tests for core component

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-17 20:55:12 +00:00
Raphael Valdetaro
7cf77d30ae
feat: add LLM Router component using OpenRouter specs (#5475)
* feat: add LLM Router component using OpenRouter specs

* [autofix.ci] apply automated fixes

* fix: resolve linting issues in LLM Router component

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-17 20:34:31 +00:00
Cristhian Zanforlin Lousa
07b26340c0
fix: adjust GenericNode width to fit component wrapper (#5768)
*  (GenericNode/index.tsx): add useEffect hook to dynamically adjust width of ReactFlow node element to fit component wrapper

* 📝 (App.css): Update width property in .react-flow__node class to improve layout responsiveness
♻️ (GenericNode/index.tsx): Remove redundant code that manually sets width of ReactFlow node element, as it is now handled by CSS styling.
2025-01-17 20:27:39 +00:00
Ítalo Johnny
59f375b61a
refactor: decompose complex function into smaller ones for readability (#5517)
* refactor: decompose complex function into smaller ones for readability

* chore: optimize output processing logic for efficiency

* Update src/backend/base/langflow/custom/custom_component/component.py

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

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-17 19:55:21 +00:00
Raphael Valdetaro
a47dee3065
feat(cohere): update settings configuration (#5682)
- Make API key field required
- Move models from advanced settings

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-01-17 19:28:20 +00:00
Vinícios Batista da Silva
518c5fe3fb
feat: improve model input fields for perplexity component (#5709)
1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-01-17 19:27:05 +00:00
Raphael Valdetaro
4bdc8ea83f
fix: remove duplicate embedding input from PGVector component (#5680)
* fix: remove duplicate embedding input from PGVector component

* refactor: move required parameter to end of embedding input declaration

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-17 19:25:01 +00:00
Gabriel Luiz Freitas Almeida
f1e150f320
fix: don't raise error if bundle loading fails (#5765)
* fix: Handle exceptions when loading bundles from URLs

* fix: Refactor bundle loading to include error handling for HTTP exceptions
2025-01-17 19:08:40 +00:00
Raphael Valdetaro
ed2a761e0b
feat: add GitExtractor component (#5459)
* feat: add GitExtractor component

* feat: add GitExtractorComponent to git module exports

* Fix linting issues in gitextractor.py

* Add GitExtractorComponent to git components exports

* refactor(GitExtractor): make tmpdir async and use context manager for cleanup

- Convert methods to async using async/await
- Add asynccontextmanager for automatic tmpdir cleanup
- Remove manual shutil.rmtree calls
2025-01-17 19:00:09 +00:00