Commit graph

14,943 commits

Author SHA1 Message Date
Vinícios Batista da Silva
47dc891ecc
feat: make YouTube Transcripts URL field required (#5686)
feat: Enhance YouTube Transcripts component by adding required field validation to URL input

This change ensures that users provide a video URL before using the YouTube Transcripts component, preventing potential runtime errors due to missing video source.
2025-01-16 21:34:39 +00:00
VICTOR CORREA GOMES
c51e57c7de
feat: Add required=True to essential inputs across Langflow components (#5739)
* fix: add required validation to input fields

Ensures mandatory fields are properly marked as required across components.

* fix: add required validation to input fields

Ensures mandatory fields are properly marked as required across components.

* fix: add required validation to input fields

field: model_name

* fix: add required validation to input fields

field: model and base_url

* fix: add required validation to input fields
input: mistral_api_key

* fix: add required validation to input fields

inputs: model, base_url, nvidia_api_key

* fix: add required validation to input fields
inputs: model, base_url

* fix: add required validation to input fields

input: openai_api_key

* fix: add required validation to input fields
inputs: message, embedding_model

* fix: add required validation to input fields
inputs: model_name, credentials

* fix: add required validation to input fields
inputs: aws_secret_access_key, aws_access_key_id

* fix: add required validation to input fields
inputs: input_text, match_text

* fix: add required validation to input fields
inputs: input_message

* fix: add required validation to input fields
inputs: input_value

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
inputs: input_value

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields

inputs: data_inputs, embeddings

* fix: add required validation to input fields
inputs: api_key, input_value

* fix: add required validation to input fields
inputs: password, username, openai_api_key, prompt

* fix: add required validation to input fields
inputs: api_key, transcription_result

* fix: add required validation to input fields
inputs: api_key, transcription_result, prompt

* fix: add required validation to input fields
input: prompt

* fix: add required validation to input fields
input: api_key

* fix: add required validation to input fields
inputs: api_key, transcript_id

* fix: add required validation to input fields
inputs: audio_file, api_key

* [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>
2025-01-16 21:26:09 +00:00
Cristhian Zanforlin Lousa
e1b5c70fa3
refactor: enhance flow type safety and clean up unused code (#5669)
* 📝 (use-save-flow.ts): add AllNodeType and EdgeType imports to improve type safety in useSaveFlow hook
📝 (index.tsx): remove unused setNoticeData function to clean up code and improve readability

* refactor: Remove unused code in GeneralPage component

* refactor: Remove unused code in cardComponent/index.tsx

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-16 21:11:07 +00:00
Sebastián Estévez
2acd434e09
feat: assistants agent improvements (#5581)
* assistants agent improvements

* remove alembic init file

* vector store / file upload support

* use sync file object (required by sdk)

* steps

* self.tools initialization

* improvements for edwin

* add name and switch to MultilineInput

* ci fixes
2025-01-16 20:54:34 +00:00
Edwin Jose
778b74dfa8
feat: Add function to validate models with tool calling function and related fixes in agent component (#5720)
* Update nvidia.py

* update agent experience with improving model selection

update agent experience with improving model selection  and making only the tool calling models available.

* variable clean up

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/base/models/model_input_constants.py

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

* Update src/backend/base/langflow/base/models/model_input_constants.py

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

* added default models

* [autofix.ci] apply automated fixes

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

* format errors solved

* [autofix.ci] apply automated fixes

* Update model.py

---------

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-16 19:11:41 +00:00
Vinícios Batista da Silva
39ef9ba1f9
feat: make AWS credentials required in bedrock component (#5710)
1. Make aws_access_key_id field required
2. Make aws_secret_access_key field required
2025-01-16 18:41:22 +00:00
Cristhian Zanforlin Lousa
c39bb39772
fix: pass slider input values correctly, add test (#5735)
*  (base.py): Update field validation to include "slider" type in addition to "float" type for better parameter handling
📝 (constants.py): Add "slider" type to the list of DIRECT_TYPES for consistency and completeness

*  (test_inputs.py): add unit test for SliderInput class to ensure it initializes with correct value

* 🐛 (base.py): fix comparison of field type with a list by changing it to a set to ensure correct condition evaluation

* [autofix.ci] apply automated fixes

* fix format

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-16 18:41:17 +00:00
Gabriel Luiz Freitas Almeida
99f2ef6115
feat: add truncation to ResultDataResponse (#5704)
* chore: Update dependencies and improve platform markers in configuration files

- Added 'hypothesis' version 6.123.17 to dev-dependencies in pyproject.toml.
- Updated platform markers from 'sys_platform' to 'platform_system' for better compatibility in uv.lock, affecting multiple packages including 'jinxed', 'colorama', and 'appnope'.
- Ensured consistency in platform checks across various dependencies to enhance cross-platform support.

This update improves the project's dependency management and ensures better compatibility across different operating systems.

* feat: Enhance ResultDataResponse serialization with truncation support

- Introduced a new method `_serialize_and_truncate` to handle serialization and truncation of various data types, including strings, bytes, datetime, Decimal, UUID, and BaseModel instances.
- Updated the `serialize_results` method to utilize the new truncation logic for both individual results and dictionary outputs.
- Enhanced the `serialize_model` method to ensure all relevant fields are serialized and truncated according to the defined maximum text length.

This update improves the handling of large data outputs, ensuring that responses remain concise and manageable.

* fix: Reduce MAX_TEXT_LENGTH in constants.py from 99999 to 20000

This change lowers the maximum text length limit to improve data handling and ensure more manageable output sizes across the application.

* test: Add comprehensive unit tests for ResultDataResponse and VertexBuildResponse

- Introduced a new test suite in `test_api_schemas.py` to validate the serialization and truncation behavior of `ResultDataResponse` and `VertexBuildResponse`.
- Implemented tests for handling long strings, special data types, nested structures, and combined fields, ensuring proper serialization and truncation.
- Enhanced coverage for logging and output handling, verifying that all fields are correctly processed and truncated as per the defined maximum text length.
- Utilized Hypothesis for property-based testing to ensure robustness and reliability of the serialization logic.

This update significantly improves the test coverage for the API response schemas, ensuring better data handling and output management.
2025-01-16 18:39:34 +00:00
github-actions[bot]
90f570edd4
chore: update test durations (#5736)
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
2025-01-16 11:06:14 -08:00
Raphael Valdetaro
d89f8e8e18
refactor: Refactor Wikipedia API component (#5432)
* refactor(wikipedia): Refactor Wikipedia API component

* test: add unit tests for WikipediaAPIComponent

* [autofix.ci] apply automated fixes

* refactor: improve WikipediaAPIComponent tests and fix lint issues

* [autofix.ci] apply automated fixes

* fix: resolve lint issues in WikipediaAPIComponent tests

---------

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-16 18:37:26 +00:00
Raphael Valdetaro
b55c9f1698
refactor: improve naming consistency in DataCombiner component (#5471)
* refactor: improve naming consistency in DataCombiner component

- Rename MergeOperation to DataOperation
- Rename component to DataCombinerComponent
- Convert operation enum values to uppercase
- Update method names for consistency

* [autofix.ci] apply automated fixes

* fix: resolved linting errors in __init__.py

* [autofix.ci] apply automated fixes

* Changed operation names to capitalize only first letter

* refactor: rename DataCombinerComponent to MergeDataComponent for better clarity and backwards compatibility

* [autofix.ci] apply automated fixes

* fix: Translate Portuguese text to English in merge_data.py

* feat: add required to data_inputs in MergeDataComponent

---------

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-16 18:37:18 +00:00
Vinícios Batista da Silva
303779e40a
feat: improve model input fields for Cohere component (#5712)
feat: improve model input fields for cohere component

1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2
3. Add info description to temperature slider
2025-01-16 18:37:14 +00:00
Gabriel Luiz Freitas Almeida
dafa85c7c6
fix: remove subscribe call and add unsubscribe method in StateService (#5727)
* feat: Implement unsubscribe functionality in state management

- Added `unsubscribe` method to `GraphStateManager` for removing observers from the state service.
- Introduced `unsubscribe` method in `StateService` with a `NotImplementedError` for future implementation.
- Implemented `unsubscribe` in `InMemoryStateService` to allow observers to be removed from the list, ensuring better management of state subscriptions.

This enhancement improves the flexibility of state management by allowing observers to unsubscribe, thus preventing potential memory leaks and ensuring cleaner state handling.

* fix: remove state manager subscribe call
2025-01-16 18:01:01 +00:00
Eric Hare
b2a3166a2c
fix: Handle the special case Azure Deployment params (#5676)
* fix: Handle the special case Azure deployment params

* Update crew.py
2025-01-16 17:45:45 +00:00
Vinícios Batista da Silva
7dce8cd499
feat: enhance AIML model input validation and UX (#5702)
* git commit -m feat: improve model input fields

1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2

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: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-16 16:27:52 +00:00
Gabriel Luiz Freitas Almeida
0ddc310122
ci: limit test duration update to unit tests and allow to continue on error (#5730)
* fix: update pytest command to target unit tests directory in GitHub Actions workflow

Modified the command in the store_pytest_durations.yml workflow to run pytest on the 'unit' tests directory instead of the 'backend' tests directory, ensuring more accurate duration tracking for unit tests.

* ci: update GitHub Actions workflow to improve pytest execution

Modified the store_pytest_durations.yml workflow to enhance the pytest command execution by removing the retry action and adding an ID for better tracking. The command now runs directly with the option to continue on error, ensuring that test durations are accurately recorded without unnecessary retries.

* refactor: update test durations and improve pytest tracking

This commit modifies the test duration tracking in the `.test_durations` file, reflecting updated execution times for various unit tests. The changes include adjustments to the duration values for multiple test cases across different modules, ensuring more accurate performance metrics. This update aims to enhance the reliability of test duration reporting in the CI pipeline.
2025-01-16 16:13:26 +00:00
Cristhian Zanforlin Lousa
d428fb6cb5
feat: Add data-testid and id attributes to app header components for testing (#5724)
* 📝 (AccountMenu/index.tsx): Add span elements with data-testid and id attributes for menu buttons for better testing and accessibility
📝 (FlowMenu/index.tsx): Add data-testid and id attributes to div elements for menu buttons for better testing and accessibility
📝 (HeaderMenu/index.tsx): Add data-testid and id attributes to DropdownMenuTrigger for user menu button for better testing and accessibility
📝 (ThemeButtons/index.tsx): Add data-testid and id attributes to Button elements for theme change buttons for better testing and accessibility
📝 (flowToolbarComponent/index.tsx): Add data-testid and id attributes to div element for API button modal for better testing and accessibility

*  (FlowMenu/index.tsx): add data-testid attributes to elements for easier testing and debugging
 (AppHeaderComponent/index.tsx): add data-testid attributes to header sections for easier testing and debugging
2025-01-16 16:05:04 +00:00
Mendon Kissling
e8dd2d4c18
docs: concepts folder (#5576)
* initial-content

* docs: update Concepts overview for clarity and accuracy

* docs: enhance clarity in Concepts documentation and fix minor inaccuracies

* docs: add detailed explanation of flow execution in Playground

* docs: enhance Concepts documentation with detailed component definitions and usage examples

* docs: remove Logs pane documentation and integrate relevant content into Playground

* docs: remove Logs section from sidebar navigation

* docs: add Logs pane overview and update Playground documentation

* docs: enhance Concepts documentation with detailed API usage examples for cURL and Python

* docs: remove unused ReactPlayer import and clean up API pane documentation

* docs: update Chat Widget embedding instructions for HTML, React, and Angular

* docs: update titles and descriptions for custom components and overview

* docs: standardize section titles for Python code and Chat widget in concepts API

* docs: clarify instructions for using Freeze Path and component options

* docs: update keyboard shortcut for Freeze Path in concepts-components documentation

* updated-image

* fix(docs): clarify session ID usage in Playground documentation

* fix-astra-component-position

* reorder-sidebar

* remove-tweak-guidance

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* fix capital case on collections

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* fix capital t in tables

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* fix: update component controls and add keyboard shortcuts for Windows

* fix: clarify component versioning and update notification details in documentation

* fix: update documentation for tool parameters and data types in components-tools.md

* fix: improve documentation clarity and formatting in concepts API, components, overview, and playground

* docs: add Working with Flows page (#5722)

* Add flows page

* style-guide-and-sidebar

---------

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

* fix-broken-link

* Update concepts-components.md

revert change to match the image

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Tejas Kumar <tejas+lol@tejas.qa>
2025-01-16 14:39:14 +00:00
Cristhian Zanforlin Lousa
a56cccd91f
refactor: add tooltips to UI global variables components (#5648)
* 📝 (GlobalVariableModal.tsx): adjust popover width from "520px" to "29rem" for better UI responsiveness
📝 (index.tsx): import ShadTooltip component and update CommandItemContent to use it for better user experience
📝 (index.tsx): update popover width from "315px" to "17.5rem" for consistency and improved design aesthetics

* 🔧 (index.tsx): add side prop to ShadTooltip component to position the tooltip on the left side of the content.

*  (index.tsx): Add support for custom node styles in CommandItemContent component to allow for more flexible styling options
🔧 (index.tsx): Pass nodeStyle prop to CommandItemContent component to customize node styles based on the provided value
2025-01-16 13:18:43 +00:00
Gabriel Luiz Freitas Almeida
1932f9a836
ci: add issues permission to Manage Labels workflow (#5706) 2025-01-15 16:34:22 -08:00
Edwin Jose
8b68bb74fb
feat: Add Support for validating Tool Mode Models in NVIDIA LLM Component (#5703)
* Update nvidia.py

* ruff format

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-16 00:15:46 +00:00
Gabriel Luiz Freitas Almeida
53d93021ba
ci: Add GitHub Actions workflow for LGTM label management (#5705) 2025-01-15 16:25:13 -08:00
anovazzi1
f4fca2b6bb
Fix: update tweaks processing to allow input_type without input_value (#5656)
* fix: tweaks processing in api usage

* refactor code

* fix: unit tests

* Refactor input handling in simple_run_flow function

* Refactor input handling in test_endpoints.py

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2025-01-15 20:43:19 +00:00
anovazzi1
1f63ebeaef
fix: Update useState default values in exportModal and flowSettingsModal (#5698)
* fix: Update useState default values in exportModal and flowSettingsModal

- Update the default values for the useState hooks in exportModal and flowSettingsModal to handle null values for currentFlow.
- Use the nullish coalescing operator (??) to set empty strings as default values for name and description.
- This ensures that the components do not throw errors when currentFlow is null or undefined.

Refs: #5670, #5672

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-15 19:44:31 +00:00
Vinícios Batista da Silva
a756061f0b
fix: add missing Needle component icon (#5689)
Replaced the generic 'search' icon with a dedicated 'Needle' icon to properly represent the Needle component in the UI, addressing the missing icon issue.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-15 18:17:34 +00:00
Cristhian Zanforlin Lousa
2f9a7858e2
refactor: Improve createFileUpload reliability and performance (#5697)
*  (create-file-upload.ts): Refactor createFileUpload function to improve readability and maintainability. Move input element creation and event listeners to separate functions for better separation of concerns. Use module-level variables for input element and promise resolver to handle cleanup and resolution more effectively.

*  (create-file-upload.ts): refactor createFileUpload function to improve code readability and maintainability. Remove unnecessary module-level variables and simplify the logic for handling file uploads.

* 📝 (create-file-upload.ts): refactor createFileUpload function to improve code readability and maintainability
🐛 (create-file-upload.ts): fix issue with resolving promise multiple times and improve file input handling

* 🔧 (create-file-upload.ts): refactor createFileUpload function to improve file upload process and cleanup event listeners for better performance and code readability

* 📝 (index.tsx): Remove unused useRef import and fileInputRef variable
♻️ (index.tsx): Refactor checkFileType function to use a for loop for better readability and performance
 (index.tsx): Introduce createFileUpload helper function to handle file selection and validation
📝 (index.tsx): Update handleButtonClick function to use createFileUpload helper function and improve file handling logic
📝 (index.tsx): Update handleButtonClick function to handle file upload and error messages more efficiently
📝 (index.tsx): Update input element to display file name and handle file selection more effectively

* add error handling in case document.body.removeChild Fails

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-15 18:03:39 +00:00
Mendon Kissling
26ed6dc2f7
docs: API examples (#5499)
* bump-api-to-1.1.1

* docs: api reference content

* more-endpoints

* cleanup

* all-endpoints-accounted-for

* docs: update API reference with user response examples and authorization header

* all-200s-complete

* fix-spacing-for-gh-preview

* sidebars

* monitor-endpoints

* fix-build-error

* fix-sidebar-error

* create-flows

* flows-endpoint-finished

* move

* files-endpoint

* run-flow

* folder-endpoint

* docs: update API reference with new endpoints and examples for flows, folders, and files

* value

* docs: update openapi.json

* docs: enhance API reference with folder-id export instructions and examples

* docs: update API reference with new flow structure and log retrieval instructions

* docs: clarify ZIP file download endpoint description in API examples

* docs: refine API examples for clarity and consistency

* docs: refine API examples for clarity and consistency

* webhook

* docs: format curl example for improved readability

* docs: update curl examples to use double quotes for variable interpolation

* docs: Update API example descriptions for improved clarity

* docs: Update API example descriptions for improved clarity

* docs: Enhance API reference with Langflow API key setup and build flow examples

* docs: update API reference examples with new event data and structure

* docs: add clarification on LLM chat response streaming in API examples

* error-and-build-vertex

* docs: remove wrong information from API examples

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* docs: Update API reference examples for environment variable exports

* docs: Fix JSON structure in API reference examples

* docs: Update API reference examples for file download and log retrieval

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2025-01-15 17:10:05 +00:00
Cristhian Zanforlin Lousa
65530e210f
fix: simplify InputFileComponent to use native file picker (#5692)
*  (index.tsx): Add useRef hook to manage file input element reference for better control over file selection process
🐛 (index.tsx): Fix handleButtonClick function to handle file selection asynchronously and provide fallback option if file selection fails
🐛 (index.tsx): Fix handleNativeInputChange function to correctly handle file selection from native file input element and reset its value after selection

* 📝 (index.tsx): Remove unused createFileUpload function and simplify handleButtonClick function to trigger file input click directly
♻️ (index.tsx): Refactor input element to use Button component for better styling and consistency

* 📝 (inputFileComponent/index.tsx): remove unnecessary comment in handleButtonClick function
2025-01-15 16:27:12 +00:00
Gabriel Luiz Freitas Almeida
8a4fc2c338
ci: Update nightly build workflow to delete existing main tags before generating new ones (#5694) 2025-01-15 16:19:52 +00:00
Christophe Bornet
da83dbbcb5
feat: Bump ruff version to 0.9 (#5666)
* Bump ruff version to 0.9

* Rename some modules for A005 ruff rule
2025-01-15 15:14:43 +00:00
Gabriel Luiz Freitas Almeida
242165b8aa
ci: Clean up build artifacts and update dependencies (#5693) 2025-01-15 05:42:33 -08:00
Gabriel Luiz Freitas Almeida
0d1c2914a4
chore: Add aiofile dependency to langflow-base (#5672) 2025-01-14 07:34:17 -08:00
Cristhian Zanforlin Lousa
b2a98163b3
fix: default flow locked property to false instead of null (#5670) 2025-01-14 06:33:11 -08:00
Cristhian Zanforlin Lousa
43d22fdcab
fix: replace hasattr with dictionary key check for flow_data nodes (#5668) 2025-01-14 05:49:45 -08:00
Cristhian Zanforlin Lousa
e7a2005188
fix: Improve update_flow data consistency, refine error handling, and add folder-moving tests (#5516)
* 🐛 (flows.py): Fix issue where flow data was not being properly updated in the database during flow update
📝 (flows.py): Improve error handling and rollback database session in case of exceptions during flow update
📝 (flows.py): Refactor code to handle unique constraint errors and provide more informative error messages
📝 (utils.py): Refactor get_webhook_component_in_flow function to handle cases where flow_data may not have 'nodes' attribute

*  (sideBarFolderButtons/index.tsx): add unique id attribute to sidebar folder buttons for improved accessibility and testing
 (general-bugs-move-flow-from-folder.spec.ts): add test to ensure user can move flow from one folder to another in the frontend application

* 🐛 (flows.py): remove unnecessary session rollback to prevent potential data inconsistency
♻️ (service.py): refactor with_session method to handle session commit and rollback more effectively

* style: adjust line breaks for readability

* style: reorder imports

* fix: ruff error try300

* [autofix.ci] apply automated fixes

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

* 🐛 (flows.py): remove unnecessary error handling code and improve exception handling for better error propagation and clarity

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/services/database/service.py

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

* use model dump besides overwrite value

* [autofix.ci] apply automated fixes

* 📝 (chat.py): improve code readability by refactoring session handling and adding comments for clarity
🔧 (chat.py): refactor code to create a fresh session for database operations and improve session management in build_flow function

* [autofix.ci] apply automated fixes

* refactor: remove unused session parameter from build_flow function in chat.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-13 22:42:53 +00:00
Gabriel Luiz Freitas Almeida
02c76a9db5
ci: Stop using uv to catch dependency timeouts in nightly workflow (#5654)
fix: stop using uv to catch dependency timeouts
2025-01-13 22:30:35 +00:00
Cristhian Zanforlin Lousa
88fa784291
fix: Improve hide-output button alignment in GenericNode component (#5645)
🔧 (GenericNode/index.tsx): Update CSS class for HiddenOutputsButton to improve styling and alignment
🔧 (GenericNode/index.tsx): Update CSS class for GenericNode component to improve alignment of elements
2025-01-13 22:19:27 +00:00
Mendon Kissling
6ad6227f14
docs: use fernet for secret key generation (#5611)
* docs: enhance authentication documentation with LANGFLOW_SECRET_KEY setup instructions

* docs: update LANGFLOW_SECRET_KEY documentation for clarity and consistency
2025-01-13 20:19:58 +00:00
anovazzi1
41d5eab261
refactor: Comment out deprecated playground page (#5616)
refactor: comment out deprecated playground page
2025-01-13 18:58:53 +00:00
Cristhian Zanforlin Lousa
40925e89a5
feat: add UI/UX improvements on InputListComponent (#5644)
* [LFOSS-74]: input list UI improvements

* [autofix.ci] apply automated fixes

* Refactor dropdown menu icon size class

* Refactor button input list component to improve code structure and remove unnecessary div element ensuring the plus icon has the same size as ... icon

* [autofix.ci] apply automated fixes

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

* revert changes to keep the plus icon bigger than ... but with right positioning

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-13 16:11:59 +00:00
Abhishek Patil
48847ba3d2
feat: bump composio libraries to version 0.6.13 (#5633) 2025-01-13 15:48:19 +00:00
Cristhian Zanforlin Lousa
5122d56ed3
test: improve element interactions in generalBugs shard 7 tests (nightly fix) (#5646) 2025-01-13 11:48:21 -03:00
Phil Miesle
f85d447748
fix: address api_request issues on Python 3.11+ (#5643)
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-13 05:19:46 -08:00
ThomaciousD
05386301c9
docs: update custom components documentation (Fixes #5595) (#5626)
* Update custom components documentation (Fixes #5595)

* docs: cleanup

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-01-10 22:19:11 +00:00
Cristhian Zanforlin Lousa
e2ff7b314b
feat: enhance URL component with improved description and render parameters (#5623)
* [LFOSS-74]: new input list UI

* [LFOSS-93]: node colors

* 📝 (Graph Vector Store RAG.json): Update description of ChatInput class to improve clarity and consistency
📝 (Graph Vector Store RAG.json): Update description of URLComponent class to improve clarity and consistency
📝 (select-items.tsx): Change noteDataType import to NoteDataType for consistency and clarity
📝 (dropdown-menu.tsx): Add RenderIcons component to display keyboard shortcuts for actions
📝 (index.tsx): Change parameter type from React.MouseEvent to KeyboardEvent for removeInput and handleDuplicateInput functions
📝 (use-overlap-shortcuts.tsx): Create custom hook to handle keyboard shortcuts with support for multiple key variations and modifiers

* 📝 (backend): Remove unnecessary metadata for URLComponent in multiple files
📝 (frontend): Refactor input components to use listAddLabel instead of metadata in multiple files

* ♻️ (NodeInputField/index.tsx): Remove unused 'metadata' variable to clean up the code and improve readability

* [autofix.ci] apply automated fixes

* merge fix

* [autofix.ci] apply automated fixes

* fix tests

* 🐛 (generalBugs-shard-5.spec.ts): fix incorrect comments numbering connections
💡 (generalBugs-shard-5.spec.ts): add clarifying comments for connection steps in the test case

* 🐛 (generalBugs-shard-5.spec.ts): fix filling delimiter in popover-anchor-input to resolve UI bug
📝 (generalBugs-shard-5.spec.ts): update test cases to improve test coverage and accuracy

*  (NodeOutputfield/index.tsx): Add top margin to improve spacing of NodeOutputField component
🔧 (generalBugs-shard-5.spec.ts): Remove commented out code related to input filling and waiting for visibility to clean up the test file and improve readability

* 🔧 (index.tsx): increase padding-right from 6 to 10 in input-edit-node class to improve spacing for better user experience

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-10 20:35:13 +00:00
Cristhian Zanforlin Lousa
febae4b589
feat: standardize node output icons with TextSearch and Chevrons (#5600)
*  (NodeInputField): Update styling to include padding-bottom when lastInput is true for better UI appearance
📝 (NodeOutputfield): Import TextSearch component from lucide-react library for future use
🔧 (RenderInputParameters): Simplify logic for determining lastInput in NodeInputField component
🔧 (GenericNode): Change icon displayed on HiddenOutputsButton based on showHiddenOutputs state
🔧 (GenericNode): Update tooltip content to include the number of hiddenOutputs when toggling visibility
🔧 (sliderComponent): Remove unnecessary padding-bottom from SliderComponent for better layout
📝 (constants.ts): Update tooltip text for better clarity and consistency with action names

*  (NodeOutputfield/index.tsx): Update import statement for IconComponent to include ForwardedIconComponent for better organization and clarity
🐛 (chatInputOutputUser-shard-0.spec.ts, chatInputOutputUser-shard-1.spec.ts): Fix references to 'ScanEye' icon to 'TextSearchIcon' for consistency and accuracy in tests
2025-01-10 18:29:00 +00:00
Phil Miesle
517961d281
fix: problem with saving files from APIRequestComponent (#5627)
* fix problem with saving files from APIRequestComponent

* moving api_request component test to appropriate subdir
2025-01-10 18:22:04 +00:00
Lucas Oliveira
3e482dbc29
feat: allow flow name to be edited from the main page or by clicking header (#5525)
* Added flowData to allow changing flow name without being on the flow

* Added being able to edit the flow name just by clicking the name

* Added handleEdit and edit details option on flow dropdown

* Added flow settings modal to grid and list

* Added flowData type and select option

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Fixed useCallback import

* Implemented details boolean to not show endpoint, changed title of flow settings modal

* Changed Flow Settings to Edit Details

* Changed Flow Settings modal description

* Fixed empty name not appearing, fixed naming conditions not considered

* 📝 (editFlowSettingsComponent/index.tsx): add data-testid attribute to input element for flow name for testing purposes
 (edit-flow-name.spec.ts): create test to ensure user can edit flow name by clicking on the header or main page, with various random names generated for testing purposes

* Fixed tests that used Flow Settings

* Fixed tests that rely on flow name to open edit details

* Fixed tests

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-10 18:14:00 +00:00
Cristhian Zanforlin Lousa
a87bd8b57b
refactor: update DataFrame color to pink (#5613)
📝 (index.css): update color variables in index.css for better consistency and readability
♻️ (styleUtils.ts): refactor nodeColorsName object in styleUtils.ts to use more descriptive color names for better clarity and maintainability
2025-01-10 15:53:14 +00:00
Rodrigo Nader
45ed8e5e54
feat(dataframe): add support for DataFrame outputs across multiple components (#5589)
* add dataframe outputs to vector stores, directory, url, split text

* add dataframe import

* [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

* Add tests for URL component functionality and data handling

* Enhance DirectoryComponent tests with new functionality and parameters

- Added tests for loading files with specific types and handling hidden files.
- Implemented tests for directory loading with depth and multithreading support.
- Introduced a new test for converting directory contents to a DataFrame.
- Updated existing tests to include additional parameters like 'silent_errors' and 'types'.

These changes improve test coverage and ensure the DirectoryComponent behaves as expected under various conditions.

* update retrieve_file_paths for backwards compatibility

* Refactor DirectoryComponent to handle file types more robustly

- Removed the default assignment of TEXT_FILE_TYPES to 'types' and added logic to use all supported types if none are specified.
- Implemented validation to ensure only valid file types are processed, improving error handling.
- Updated the file retrieval process to utilize the filtered list of valid types.

These changes enhance the flexibility and reliability of the DirectoryComponent's file loading functionality.

* Refactor and simplify tests in test_data_components.py

- Removed multiple tests related to HTTP requests, including successful and failed GET requests, timeouts, and multiple URL handling, to streamline the test suite.
- Cleaned up imports and unnecessary mock setups to enhance readability and maintainability.
- Focused on retaining essential tests for DirectoryComponent and URLComponent functionality, ensuring core features are still validated.

These changes improve the clarity and efficiency of the test suite while maintaining coverage for critical components.

* Add unit tests for DirectoryComponent functionality

- Introduced a new test file for DirectoryComponent, enhancing test coverage.
- Implemented various tests to validate loading files with specific types, handling hidden files, and supporting multithreading.
- Added tests for directory loading with depth and converting directory contents to a DataFrame.
- Ensured tests cover different scenarios, including recursive loading and file type filtering.

These changes improve the robustness and reliability of the DirectoryComponent's functionality through comprehensive testing.

* Add unit tests for URLComponent functionality

- Introduced a new test file for URLComponent, enhancing test coverage for its methods.
- Implemented tests for fetching content from valid URLs, handling multiple URLs, and validating error handling for invalid URLs.
- Added tests for converting fetched content to a DataFrame and ensuring correct message formatting.
- Mocked web requests to simulate various scenarios, ensuring robust testing of URLComponent's functionality.

These changes improve the reliability and correctness of the URLComponent through comprehensive testing.

* Add unit tests for SplitTextComponent functionality

- Introduced a new test file for SplitTextComponent, enhancing test coverage for its methods.
- Implemented tests for basic text splitting, handling overlaps, custom separators, and preserving metadata.
- Added tests for converting split text results to a DataFrame and handling empty input.
- Ensured functionality for single and multiple input texts is validated.

These changes improve the reliability and correctness of the SplitTextComponent through comprehensive testing.

* Add comment to ignore FBT001 in retrieve_file_paths function

* Validate specified file types in DirectoryComponent and raise ValueError for invalid types

* Fix type hint in DataFrame constructor to support list of dicts or Data objects. This change enhances type safety and clarity in the DataFrame initialization process.

* Enhance DirectoryComponent tests to validate error handling for invalid file types

- Removed the test case for 'exe' file type from valid scenarios.
- Added a new test to ensure DirectoryComponent raises a ValueError for invalid file types, specifically when 'exe' is specified.
- Improved test coverage for DirectoryComponent by validating error messages for unsupported file types.

These changes strengthen the reliability of the DirectoryComponent by ensuring proper error handling for invalid inputs.

* [autofix.ci] apply automated fixes

* Update error handling in Component class to return None for missing flow_id or session_id

- Modified the send_error_message method to include a type hint that allows for returning None in addition to Message.
- Added a conditional check to return None if flow_id or session_id is not present, improving robustness in error handling.

These changes enhance the reliability of the Component class by ensuring it gracefully handles cases with missing identifiers.

* Refactor error handling in Component class to return None for missing session_id

- Updated the send_error_message method to remove the flow_id check, simplifying the logic.
- Enhanced robustness by ensuring that the method returns None if session_id is not present.

These changes improve the reliability of the Component class in handling error messages.

* Update required_inputs for DataFrame method in JSON configurations

- Modified the 'required_inputs' field for the 'DataFrame' method in both 'Graph Vector Store RAG.json' and 'Vector Store RAG.json' files to include necessary parameters: 'api_endpoint', 'collection_name', and 'token'.
- In 'Vector Store RAG.json', added 'collection_name_new' to the 'required_inputs' list.

These changes ensure that the DataFrame method has the appropriate inputs defined for proper functionality.

* [autofix.ci] apply automated fixes

* Enhance BaseComponent to use deep copy for attribute values in template configuration

- Updated the BaseComponent class to utilize `copy.deepcopy` when assigning values to `template_config`. This change ensures that modifications to the original component's attributes do not affect the template configuration, enhancing data integrity and preventing unintended side effects.

These changes improve the reliability of the BaseComponent by ensuring that the template configuration remains consistent and isolated from the original component's state.

* Added output for 'dataframe' in both ingestion and rag graphs

- Updated the ingestion vector store ID for better identification.
- Added output for 'dataframe' in both ingestion and rag graphs to enhance data handling.
- Simplified the output assignment for search results in rag graph by using a data list.

These changes improve the test structure and ensure that the vector store components are correctly configured for better testing outcomes.

* Refactor vector store RAG tests for improved validation and consistency

- Updated test assertions in `test_vector_store_rag_dump_components_and_edges` to verify the expected number of nodes and their types using a mapping for easier lookup.
- Changed the ingestion vector store ID from `vector-store-123` to `ingestion-vector-store-123` for better identification.
- Adjusted expected edges in the tests to reflect the new vector store ID, ensuring accurate edge validation.

These changes enhance the test structure and ensure that the vector store components are correctly configured for better testing outcomes.

---------

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-10 14:50:30 +00:00