Commit graph

14,971 commits

Author SHA1 Message Date
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
Vinícios Batista da Silva
ac8d61a27c
feat: improve model input fields for OpenRouter component (#5715)
feat: improve model input fields for openrouter component

1. Make provider and model_name fields required
2. Add info description to temperature slider
3. Improve code formatting
2025-01-17 18:57:13 +00:00
Raphael Valdetaro
656f9f30db
feat: Add DeepSeek Model component (#5443)
* feat: Add DeepSeek component

* Adiciona DeepseekModelComponent ao __init__.py

* [autofix.ci] apply automated fixes

* Add DeepSeek icon and update component files

* Add DeepSeek icon and update all related files

* [autofix.ci] apply automated fixes

* Change DeepSeek icon color to blue (#080c34)

* [autofix.ci] apply automated fixes

* Revert DeepSeek icon color to black

* [autofix.ci] apply automated fixes

* remove: name parameter from DeepSeekModel to avoid backwards compatibility issues

* test: add unit tests for DeepSeek model component with mocks

* fix: correct formatting issues in DeepSeek model tests

* feat: update DeepSeek icon color to #4c6cfc

* fix: make DeepSeek API key field required

* fix: format SecretStrInput to comply with line length limit in DeepSeekModelComponent

* feat: add dark mode support for component icon

* [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 17:45:39 +00:00
Christophe Bornet
b3fd941bf6
fix: Fix mem leak in Graph process (#5751)
Fix mem leak in Graph process
2025-01-17 17:18:45 +00:00
Vinícios Batista da Silva
5848b11caa
feat: improve model input fields for sambanova component (#5708)
* feat: improve model input fields for sambanova component

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

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

* feat: improve model input fields for sambanova component

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

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-17 17:17:24 +00:00
Cristhian Zanforlin Lousa
36b3289da2
test: Update API key requirements and test configurations for frontend tests (#5752) 2025-01-17 06:17:26 -08:00
Christophe Bornet
a5f5f3e3e3
fix: Fix memory leak when creating components (#5733)
Fix memory leak when creating components
2025-01-16 22:41:25 +00:00
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