Commit graph

13,917 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
ef11e98c8f
fix: force floatInputComponent to send Number (#3953)
🔧 (floatComponent/index.tsx): update handleChange function to convert input value to a number before passing it to onChange function
2024-09-27 20:41:58 +00:00
Gabriel Luiz Freitas Almeida
35d81b7e34
feat: Add components_only parameter to filter flows by components in API endpoint (#3932)
* Add fixture for creating flow component in tests

* Add test for reading flows with components only in test_database.py

* Add `components_only` parameter to filter flows by components in API endpoint
2024-09-27 18:18:24 +00:00
Cristhian Zanforlin Lousa
6db15255a5
feat: improve file uploader size validation - custom hook (#3952)
* 📝 (inputFileComponent/index.tsx): add useFileSizeValidator hook to validate file size before upload to improve code readability and maintainability

* 📝 (chatInput/index.tsx): remove unused imports and refactor file size validation to use a custom hook for better code organization and readability

* 📝 (FileInput/index.tsx): refactor file input component to use a custom hook for file size validation instead of utility store
🔧 (FileInput/index.tsx): remove dependency on utility store for max file size upload and use a custom hook for file size validation instead

*  (use-file-size-validator.tsx): introduce a new custom hook useFileSizeValidator to validate file size before uploading it
2024-09-27 18:01:16 +00:00
Cristhian Zanforlin Lousa
29404c79ba
fix: update storeMessageComponent input types (#3950)
* 📝 (StoreMessage.py): Change StrInput to MessageInput for sender, sender_name, and session_id inputs to improve clarity and consistency in the code.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 14:51:24 -03:00
Eric Hare
077a061a2a
FIX: do not use cached vector store on inserts (#3948) 2024-09-27 16:55:13 +00:00
Gabriel Luiz Freitas Almeida
706f9a0277
refactor: update flaky tests in test_schema.py (#3933)
* Fix flaky tests in `test_schema.py` by using sets for type comparisons

- Updated `post_process_type` function assertions to use sets for more reliable type comparisons.
- Adjusted imports for better code organization.

* Fix import order in test_database.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 16:45:26 +00:00
Cristhian Zanforlin Lousa
8facb67944
tests: improve tests of store (#3949)
 (store-shard-1.spec.ts): Improve test case for liking and adding components and flows by adding more specific selectors and reducing timeout durations for better performance and reliability
 (store-shard-3.spec.ts): Enhance test case for filtering by type by adding more specific selectors and reducing timeout durations for better performance and reliability
2024-09-27 16:39:39 +00:00
Jordan Frazier
8e50f2fdbb
feat: add csv output parser (#3483)
* Adds the CSV Output Parser

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-27 16:36:04 +00:00
Cristhian Zanforlin Lousa
948b150946
feat: truncate parsed uploads to prevent database and frontend blocking caused by excessively large files (#3914)
* 📝 (constants.ts): increase maxSizeFilesInBytes constant value from 10MB to 100MB to allow larger file uploads

* 🐛 (inputFileComponent): fix bug in setting the maximum file size alert message to display the correct file size limit of 100 bytes instead of 10 bytes

* 📝 (schemas.py): Add a new field_serializer method to serialize data in VertexBuildResponse class
📝 (schemas.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries
📝 (model.py): Add a new field_serializer method to serialize outputs in TransactionBase class
📝 (model.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries
📝 (model.py): Add a new field_serializer method to serialize data and artifacts in VertexBuildBase class
📝 (model.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries

* 🐛 (schemas.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (model.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (model.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (index.tsx): truncate resultMessage to 99999 characters and add message if text is too long

* 🔧 (switchOutputView/index.tsx): Use useMemo to memoize resultMessage transformations for performance optimization

* 🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (index.tsx): Fix logic to correctly handle resultMessageMemoized when it is an object

* 📝 (model.py): refactor truncate_text function to truncate_long_strings for better clarity and consistency
📝 (model.py): update serialize_outputs and serialize_artifacts functions to use truncate_long_strings for string truncation
📝 (model.py): introduce MAX_TEXT_LENGTH constant for defining the maximum length of text to truncate in the models

* 📝 (schemas.py): refactor serialize_data method in VertexBuildResponse class to use a new helper function truncate_long_strings for better code readability and maintainability

* 🔧 (schemas.py): Move the `truncate_long_strings` function to a separate module to improve code organization and reusability
🔧 (model.py): Import the `truncate_long_strings` function from the correct module to fix the reference error
🔧 (model.py): Import the `truncate_long_strings` function from the correct module to fix the reference error

* 📝 (util.py): add function truncate_long_strings to recursively truncate long strings in dictionaries and lists to prevent exceeding the maximum text length.

* 📝 (constants.py): add constant MAX_TEXT_LENGTH with value 99999 for defining maximum text length allowed in the application

* 📝 (model.py): update import path for truncate_long_strings function to match new location in util module

*  (test_truncate_long_strings_on_objects.py): Add unit tests for the function truncate_long_strings to ensure correct behavior when truncating long strings in various data structures
🐛 (switchOutputView/index.tsx): Fix truncation logic to correctly truncate long strings by adding ellipsis at the end instead of displaying additional text about truncation.

* [autofix.ci] apply automated fixes

*  (test_truncate_long_strings_on_objects.py): Update import path for truncate_long_strings function
📝 (test_truncate_long_strings_on_objects.py): Add additional tests for handling negative, zero, and small max_length values in truncate_long_strings function

* ♻️ (schemas.py): refactor import statement to use the updated module name util_strings instead of util for better clarity and consistency.

* 📝 (model.py): Update import path for util_strings module to fix module import error
📝 (util.py): Remove redundant code for truncating long strings and move it to a separate util_strings module for better organization and separation of concerns.

* 📝 (schemas.py): refactor serialize_data method to handle both BaseModel and non-BaseModel data inputs in VertexBuildResponse class

* 📝 (util_strings.py): Update util_strings.py to improve string truncation function for dictionaries and lists
🔧 (test_truncate_long_strings_on_objects.py): Update test cases for string truncation function to cover additional scenarios and edge cases

* Update src/backend/base/langflow/utils/util_strings.py

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

* 📝 (vite.config.mts): update environment variable MAX_FILE_SIZE to be defined in vite config for frontend to use in the application.

* 📝 (constants.ts): update maxSizeFilesInBytes constant to use process.env.MAX_FILE_SIZE environment variable for configurable file size limit
📝 (constants.ts): add MAX_TEXT_LENGTH constant with a value of 99999 for maximum text length limit

* 📝 (switchOutputView/index.tsx): import MAX_TEXT_LENGTH constant from shared constants file to improve code organization and reusability

*  (langflow/__main__.py): add support for defining maximum file size for upload in MB to improve user experience and prevent large file uploads

* 🐛 (files.py): add validation to check if uploaded file size exceeds the maximum allowed size before processing it

*  (schemas.py): add max_file_size_upload field to ConfigResponse schema to handle maximum file size allowed for upload

* 🔧 (vite.config.mts): remove MAX_FILE_SIZE environment variable configuration as it is no longer needed

*  (base.py): introduce max_file_size_upload setting to limit the file size for uploads in MB

* 🐛 (util.py): add support for setting max_file_size_upload in update_settings function to allow configuring maximum file size for uploads

* 📝 (inputFileComponent/index.tsx): add support for retrieving max file size upload from utility store to improve code modularity and reusability
🐛 (inputFileComponent/index.tsx): fix error handling logic to display error message when uploading a file fails

* 📝 (constants.ts): remove maxSizeFilesInBytes constant as it is no longer used and update MAX_TEXT_LENGTH constant to a higher value

*  (use-get-config.ts): add functionality to set max file size upload value from config response

*  (utilityStore.ts): introduce maxFileSizeUpload property and setMaxFileSizeUpload function to handle maximum file size upload in bytes

*  (frontend): introduce maxFileSizeUpload property and setMaxFileSizeUpload method to handle maximum file size upload functionality in the UtilityStoreType

* ♻️ (util_strings.py): refactor truncate_long_strings function to improve code readability and consistency by removing unnecessary whitespace and aligning assignment operators.

* 🐛 (files.py): fix formatting issue in the raise statement to improve code readability and maintain consistency

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-27 15:44:05 +00:00
Gabriel Luiz Freitas Almeida
b34a7c7f02
fix: Handle group nodes in graph sorting (#3929)
* Fix: Handle group nodes in graph sorting

- Added `get_root_of_group_node` function to identify the root of a group node.
- Updated `sort_up_to_vertex` to use `get_root_of_group_node` for handling group nodes.
- Modified `__filter_vertices` to pass `parent_node_map` to `sort_up_to_vertex`.

* Refactor: Update NodeStatus component to handle group nodes and improve build status handling

* [autofix.ci] apply automated fixes

* Update type hint for parent_node_map in sort_up_to_vertex function

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 15:26:20 +00:00
Cristhian Zanforlin Lousa
3ddd123b66
feat: add dynamic metadata to components + search on sidebar (#3945)
*  (frontend_node/base.py): add metadata attribute to store additional information for the component node

*  (constants.py): add 'metadata' attribute to NODE_FORMAT_ATTRIBUTES list to include additional metadata information for nodes in the application.

* 📝 (attributes.py): add new function getattr_return_dict to return a dictionary if the value is of type dict, otherwise return an empty dictionary. Update ATTR_FUNC_MAPPING to include the new function for the "metadata" attribute.

* update basic examples

* 📝 (extraSidebarComponent/index.tsx): refactor handleSearchInput function to improve code readability and maintainability
🐛 (extraSidebarComponent/index.tsx): fix searchInMetadata function to correctly handle nested objects in metadata for search functionality

* 📝 (component.py): add _metadata attribute to CONFIG_ATTRIBUTES list to include it in the configuration attributes
2024-09-27 12:19:35 -03:00
anovazzi1
5dec9cca9b
fix: usePatchUpdateFlow to conditionally refetch queries based on the browser URL (#3915)
* fix usePatchUpdateFlow to conditionally refetch queries based on the browser URL, preventing unecessary request

* [autofix.ci] apply automated fixes

* Refactor PageComponent to remove unnecessary query using useQueryClient

* Refactor usePatchUpdateFlow to conditionally refetch queries based on the browser URL

* [autofix.ci] apply automated fixes

* Refactor PageComponent to remove unnecessary query using useQueryClient

* Implement query cache cleanup on MainPage unmount

* fix spelling

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 12:12:49 -03:00
anovazzi1
f906059a72
fix: animation of building edges on build stop (#3937)
fix: remove animation of builidng edges on build stop
2024-09-27 14:44:27 +00:00
Jordan Frazier
1bf6781dc4
fix: use init_subclass instead of metaclass to enforce decorator (#3942)
* Use init_subclass instead of metaclass to enforce decorator

* [autofix.ci] apply automated fixes

* fix imports

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 12:06:15 +00:00
Cristhian Zanforlin Lousa
232b0d7d00
fix: truncate text on filter to x icon fits the parent div (#3941)
🔧 (index.tsx): improve layout of sidebarFilterComponent to display type in a more readable way
2024-09-26 20:52:38 +00:00
Cristhian Zanforlin Lousa
11d0f4487b
fix: search for the parent category on sidebar (#3940)
* 📝 (extraSidebarComponent/index.tsx): refactor handleSearchInput function to use a normalizeString helper function for better code readability and maintainability

* ♻️ (extraSidebarComponent/index.tsx): remove unnecessary console.log statement from the code
2024-09-26 16:51:59 -03:00
Gabriel Luiz Freitas Almeida
bf2aadf6a4
refactor: update dependency versions and streamline backend installation commands (#3939)
* Update Makefile to streamline backend dependency installation commands

* Update dependency versions in pyproject.toml for weaviate-client, httpx, and others

* Update dependency versions in pyproject.toml for better compatibility and stability

* new lock

* refactor: streamline backend dependency installation commands

* update examples formatting
2024-09-26 12:23:26 -07:00
Gabriel Luiz Freitas Almeida
b877bc9e08
fix: Add 'langflow' to workspace configuration (#3935)
Add 'langflow' to workspace configuration in pyproject.toml
2024-09-26 12:07:03 -07:00
Mike Fortman
5520cb647b
refactor: Update parameter order and hide token for DS users (#3920)
* Update parameter order and hide token for DS users

* cleanup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-26 06:31:00 -07:00
Gabriel Luiz Freitas Almeida
56d8b0fa49
fix: handle coroutine check for on_disconnect callback in chat API (#3930)
Handle coroutine check for on_disconnect callback in chat API
2024-09-26 13:28:17 +00:00
Gabriel Luiz Freitas Almeida
31db1267b4
fix: update pyproject.toml to use workspace configuration for langflow-base (#3928)
Update pyproject.toml to use workspace configuration for langflow-base
2024-09-26 05:49:56 -07:00
Nicolò Boschi
616c01813e
chore: drop duckdb usage and migrations (#3730)
* chore: drop duckdb usage and migrations

* [autofix.ci] apply automated fixes

* Add DefaultModel and MessageResponse classes with custom JSON serialization and validation

- Introduced `DefaultModel` class with custom JSON encoders and serialization methods.
- Added `MessageResponse` class inheriting from `DefaultModel` with fields for message details and custom validators/serializers.
- Enhanced file handling and timestamp formatting in `MessageResponse`.

* Refactor: Replace `MessageModelResponse` with `MessageResponse` in monitor API

- Updated import statements to use `MessageResponse` from `langflow.schema.message`.
- Modified `/messages` endpoint to return `list[MessageResponse]` instead of `list[MessageModelResponse]`.
- Adjusted response model validation to use `MessageResponse`.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-26 11:48:35 +00:00
Jordan Frazier
17cc9bafcd
fix: remove bson import (#3924)
Remove bson import
2024-09-26 11:46:37 +00:00
Phil Nash
7a01cf7e5b
feat: adds model selection to Azure OpenAI Embeddings component (#3882)
Right now the Azure OpenAI Embeddings component doesn't allow you to pick the embedding model to use. The same models are available that OpenAI make available, so I used the constant that lists them to pull from.
2024-09-26 04:29:04 -07:00
anovazzi1
106a34d2ff
fix: unnecessary re-renders in PageComponent and update edgeTypes (#3917)
fix: Update edgeTypes in PageComponent to prevent unecessary re-renders and remove console alert
2024-09-26 04:27:10 -07:00
Sebastián Estévez
fbb097dc4c
chore: uv to replace poetry (#3900)
* uv sync works

* fist stab at Makefile

* uv treatment for langflow-base

* sqlmodel to 0.0.18

* add reinstall_backend to Makefile

* makefile - reinstall_backend fix and unit_test dependency

* fix dev dependencies

* fix dev dependencies

* fix dev dependencies

* lock

* Makefile

* [autofix.ci] apply automated fixes

* Update Makefile

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

* delete update_dependencies

* fix lint

* Remove Poetry lock check from GitHub Actions workflow

* Switch to 'uv' for dependency management and caching in style-check workflow

* Update style-check workflow to use '--only-dev' flag for Ruff check

* Integrate 'uv' package setup and caching in GitHub Actions workflows

* Update version check in GitHub Actions to use 'uv tree' for langflow-base

* Remove redundant poetry environment setup in GitHub Actions workflow

* Add step to minimize uv cache in GitHub Actions workflow

* Update GitHub Actions workflow to use 'uv' for dependency management and caching

* Remove redundant script execution from build_langflow target in Makefile

* [autofix.ci] apply automated fixes

* Switch build system from Poetry to Hatchling and update dependencies

- Replace `poetry-core` with `hatchling` in build-system requirements
- Update `langflow-base` dependency to version `0.0.96`
- Add `tool.hatch.build.targets.wheel` configuration
- Adjust `tool.uv.sources` paths for `langflow-frontend` and `langflow-base`

* update lock

* Switch build system from Poetry to Hatchling in pyproject.toml

* Add langchain-unstructured dependency to pyproject.toml

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-25 13:40:30 -07:00
Cristhian Zanforlin Lousa
17fc2482a0
fix: "Start Here" button not working as expected + fe tests (#3910)
*  (general-bugs-shard-3909.spec.ts): add test case to ensure user can create a new flow by clicking on "Start Here" button

*  (componentsComponent/index.tsx): Add NewFlowModal component to allow users to create a new flow
📝 (componentsComponent/index.tsx): Update ComponentsComponent to handle opening and closing of NewFlowModal

*  (emptyComponent/index.tsx): refactor EmptyComponent to use useIsFetching hook from @tanstack/react-query for loading state and pass handleOpenModal as a prop to improve code readability and maintainability

*  (componentsComponent/index.tsx): refactor handleOpenModal function to improve code readability and maintainability
2024-09-25 19:31:45 +00:00
Eric Hare
cf5b5951c4
bugfix: Properly output a Tool from Glean Search (#3851)
* bugfix: Properly output a Tool from Glean Search

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-25 11:33:16 -07:00
dependabot[bot]
44a78bd7cf
build(deps): bump rollup from 4.21.1 to 4.22.4 in /src/frontend (#3897)
Bumps [rollup](https://github.com/rollup/rollup) from 4.21.1 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.21.1...v4.22.4)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-25 17:54:16 +00:00
Christophe Bornet
f8a2a7d3b8
feat: Activate ruff rules UP(pyupgrade) (#3871)
* Activate ruff rules UP(pyupgrade)

* Set ruff target version

* Fix threading.Lock | None error
Due to https://github.com/python/cpython/issues/114315

* Fix Text in custom component supported typed

* Fix mypy issues

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-25 17:38:50 +00:00
Patrick Loeber
c567323413
feat: add AssemblyAI components (#3829)
* Add AssemblyAI components

* add icons

* [autofix.ci] apply automated fixes

* Add ruff 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>
2024-09-25 17:32:03 +00:00
Christophe Bornet
381348456d
feat: Add ruff rules to sort imports (I) (#3869)
Add ruff rules to sort imports (I)
2024-09-25 08:46:35 -07:00
Eric Hare
f403c17d10
FIX: proper parameters in Astra DB Vectorize options (#3901)
* FIX: proper parameters in vectorize options

* Update test_astra_component.py
2024-09-24 12:43:23 -07:00
Jordan Frazier
b12fa9f874
ci: explicitly pass secrets for fe test (#3905)
explicitly pass secrets
2024-09-24 19:21:09 +00:00
Mike Fortman
8ed93654f2
feat: add tracking and custom param label (#3902)
* add tracking and custom param label

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-24 14:00:34 -05:00
Mendon Kissling
7b99f01340
Docs: update components to v1.0.18 (#3903)
* embeddings

* helpers

* vector-stores

* hashes
2024-09-24 15:29:31 -03:00
Eric Hare
b59ae6befa
bugfix: Handle prompts with no Chat messsages (#3892)
Also require API key  for langsmith
2024-09-24 14:07:45 +00:00
dependabot[bot]
e0e54a3ed0
build(deps-dev): bump vite from 5.4.2 to 5.4.7 in /src/frontend (#3889)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.2 to 5.4.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 06:49:52 -07:00
Jan Cheng
a4ae2b52a0
fix: Server is busy (#3878) (#3895) 2024-09-24 06:49:30 -07:00
Sebastián Estévez
0f97d359f8
fix: update assistants components and add integrations tests (#3887)
* fixes and integrations tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-24 05:27:15 -07:00
Jordan Frazier
ed53fcd3b0
fix: outputs_map parameter namings (#3886)
fix outputs_map parameter namings
2024-09-23 17:22:58 -07:00
Yuqi Tang
34ef5f5964
Add undo/redo check (#3893)
* add check for other browsers

* [autofix.ci] apply automated fixes

* add command + zand y test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-23 21:12:59 -03:00
Jordan Frazier
f802f9a92a
ci: make nightly run all fe tests (#3888)
make nightly run all fe tests
2024-09-23 18:35:23 +00:00
Patrick Loeber
19023e59ba
docs: Add AssemblyAI integration docs (#3885)
add assemblyai integration docs
2024-09-23 16:08:58 +00:00
anovazzi1
bf9ded5063
fix: Update class name in PageComponent (#3842)
* refactor: Update class name in PageComponent

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-09-23 15:28:52 +00:00
Cristhian Zanforlin Lousa
ad97ee9830
fix: image not been sent on ChatInputComponent during runtime of building a flow (#3862)
* refactor: Refactor file path rewriting logic

This commit refactors the logic for rewriting file paths in the `rewrite_file_path` function. The function now splits the file path by "/" and checks if it has at least two parts. If it does, it creates a consistent file path by concatenating the last two parts. If not, it returns the original file path. This change improves the consistency of file paths in the codebase.

Refactor the file path rewriting logic in the `rewrite_file_path` function.

* refactor: Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

*  (general-bugs-shard-3836.spec.ts): update test description to be more specific about the tool used for sending images on chat
📝 (general-bugs-shard-3836.spec.ts): remove unused import of readFileSync from fs module

*  (test_rewrite_file_path.py): add unit tests for the rewrite_file_path function to ensure correct behavior with various file path scenarios

* ♻️ (utils.py): refactor file_path function to handle both forward and backward slashes and extract file path after drive letter if present

* style: fix single quotes, commas, and spaces

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-23 12:19:09 -03:00
Mendon Kissling
fc1e78f69d
docs: fix link in vector store rag description (#3884)
fix
2024-09-23 15:15:44 +00:00
Edwin Jose
ab2df9ef3d
feat: Enhance Data Components and Add SelectData Functionality (#3715)
## Changes Overview

This PR introduces several enhancements to our data handling components and removes some legacy code:

1. **CreateData and UpdateData Components**:
   - Added text key name validation
   - Enhanced UpdateData to support updating and appending multiple data points
   - Implemented optional text key validator for dynamically loaded data
   - Updated component names, descriptions, and default values

2. **New SelectData Component**:
   - Implemented SelectDataComponent for data selection from a list
   - Added inputs for data list and index selection
   - Implemented error handling for out-of-range index selection

3. **Code Cleanup**:
   - Removed legacy post_code_processing methods from CreateDataComponent and UpdateDataComponent
   - Removed corresponding test cases

4. **Testing**:
   - Added unit tests for CreateData and UpdateData components
   - Updated test file names for consistency
2024-09-22 18:19:51 +00:00
Edwin Jose
1caba1cd7c
feat: Enhance HuggingFaceEndpointsComponent with additional parameters (#3846)
* Update HuggingFaceInferenceAPIEmbeddings.py

update to use inference api from hugging face

* Enhance HuggingFaceEndpointsComponent with additional parameters

- Add FloatInput for top_p, typical_p, temperature, and repetition_penalty
- Update create_huggingface_endpoint and build_model methods to include new parameters
- Set default values and info for new inputs

ToDo Need to update the Package
from langchain_community.llms.huggingface_endpoint import HuggingFaceEndpoint

since its depreciated.

* Updated HuggingFaceModel Solving Lint Error

Updated HuggingFaceModel Solving Lint Error

* Update HuggingFaceModel.py

Added Inference Endpoint as an input from user to support custom inference endpoints

* Update HuggingFaceModel.py

paper references removed
2024-09-21 19:08:08 +00:00
Cristhian Zanforlin Lousa
aa2578370b
fix: limit file upload size to 10mb to prevent LF crashing due data render component limitations (#3870)
* 🐛 (inputFileComponent/index.tsx): add check for file size before uploading to prevent uploading files larger than the maximum allowed size

*  (alerts_constants.tsx): add new constant INVALID_FILE_SIZE_ALERT to display an alert message when the file size is too large

*  (constants.ts): add constant maxSizeFilesInBytes to define the maximum file size allowed for upload in bytes

* 🐛 (inputFileComponent/index.tsx): update INVALID_FILE_SIZE_ALERT parameter from 9 to 10 to match the new file size limit
🐛 (constants/constants.ts): increase maxSizeFilesInBytes constant value from 9MB to 10MB to reflect the new file size limit
2024-09-20 18:33:02 -03:00