Commit graph

15,301 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
d3b07f68a7
Fix: Reset Edge Update Tracking Before Success Message in UpdateAllComponents (#6797)
🔧 (.gitattributes): mark *.wav files as binary to prevent line ending conversions
♻️ (UpdateAllComponents/index.tsx): refactor code to use separate functions for resetting and starting edges update reference to improve readability and maintainability
2025-02-24 23:04:59 +00:00
Lucas Oliveira
3257c5720e
fix: handle null and boolean correctly on table parameter (#6722)
* Added Null, Undefined and Bool rendering to table

* Handling formatter to come from the backend in table definitions

* Added validator to make type as formatter and vice versa

* Added boolean case to show badge

* Added Toggle Cell Editor

* Supress Row Click Selection on Table node component

* ADd boolean as type for formatter

* Adds Boolean formatter type to show toggle editor

* run format_backend

*  (tableInputComponent.spec.ts): update unit test for table input component to use new methods for interacting with elements and improve readability and maintainability of the test code.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-02-24 21:33:34 +00:00
Cristhian Zanforlin Lousa
5e40c5f199
test: add FE tests for new starter project templates (#6772)
*  (Research Translation Loop.spec.ts): add integration test for Research Translation Loop functionality in the frontend to ensure proper functionality and behavior.

*  (Price Deal Finder.spec.ts): Add integration test for Price Deal Finder feature
📝 (Price Deal Finder.spec.ts): Document test cases and setup for Price Deal Finder feature
♻️ (Research Translation Loop.spec.ts): Refactor test setup and add missing test case for Research Translation Loop feature

* add tests to new started projects
2025-02-24 21:27:29 +00:00
Edwin Jose
38c895994a
feat: add setter to dataframe to handle missing text_keys (#6785)
* update the templates and add error handling

* [autofix.ci] apply automated fixes

* updated changes

* update to template from main

* Update split_text.py

* Add validation for text key in DataFrame setter

---------

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-02-24 20:47:56 +00:00
Eric Hare
8f276ad94c
fix: Update Vector Store RAG template dialog order (#6740)
* fix: Update vector store template dialog order

* Update Vector Store RAG.json

* Update Vector Store RAG.json

* Restore OPENAI_API_KEY as default in VSR

* Update Vector Store RAG.json

* Update Vector Store RAG.json

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-24 20:41:09 +00:00
Gabriel Luiz Freitas Almeida
46be362387
chore: Update langflow and langflow-base package versions to 1.2.0 and 0.2.0 (#6759)
fix: Update package versions for langflow and langflow-base to 1.2.0 and 0.2.0 respectively
2025-02-24 20:33:17 +00:00
Cristhian Zanforlin Lousa
7b85505117
feat: Improve data handling and text formatting (loop fix) (#6771)
* 📝 (loop.py): Improve code readability and semantics by updating the return condition in the LoopComponent class
📝 (data.py): Enhance the data_to_text_list function to handle various data structures and ensure consistent text formatting
📝 (LoopTemplate.json): Update the LoopComponent class description and method implementations for better clarity and maintainability
📝 (test_data_to_text_list.py): Add unit tests to cover different scenarios and edge cases for the data_to_text_list function

* [autofix.ci] apply automated fixes

* 📝 (langflow): Add noqa comments to ignore linting rule A005 for specific files in the project. Fix type annotations and improve error handling in data.py module. Add noqa comments to ignore linting rule A005 for specific files in the project.

*  (test_data_to_text_list.py): update parameter names in pytest.mark.parametrize to improve readability and maintainability

* 🐛 (data.py): refactor error message handling in data_to_text_list function to improve readability and maintainability

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/helpers/data.py

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

* ♻️ (data.py): refactor data_to_text_list function to simplify the logic and improve readability by removing unnecessary if conditions and updating the format_dict directly from data_obj.data.

*  (test_data.py): refactor test_data_to_text_list function to handle defaultdict behavior and improve test coverage

*  (loop-component.spec.ts): update test expectation to match the correct number of occurrences of "modified_value" in the output

*  (Memory Chatbot.spec.ts): add assertion to check if the concatenated text length is greater than 20 to ensure the chatbot response is meaningful

---------

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-02-24 20:27:34 +00:00
Cristhian Zanforlin Lousa
05935ed2f3
feat: Add option to disable vector store caching (#6713)
* add possibility to user cache or not vector stores - default is cached

* update started projects

* [autofix.ci] apply automated fixes

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

* updating vector store template

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-24 19:22:05 +00:00
Cristhian Zanforlin Lousa
87886fbbac
fix: improve edge state management using object structure (#6764)
* 🔧 (UpdateAllComponents/index.tsx): refactor the logic to track the number of edges before update and update component status for better error handling and user notification.

* ♻️ (UpdateAllComponents/index.tsx): refactor variable names for better readability and semantics
2025-02-24 17:09:59 +00:00
youyyytrok
122bc99119
fix: broken links (#6686)
* Update broken link index.tsx

* Update broken link  index.tsx
2025-02-24 17:09:45 +00:00
Mendon Kissling
c18f65cac9
docs: astra component update (#6720)
* starter-project-update

* update-component-add-vectorize

* update-quickstart

* style-cleanup

* Apply suggestions from code review

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

* split-large-steps-add-admonition

* dimensions-not-required-for-astra-vectorize

* Apply suggestions from code review

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

* fix-numbering

* Apply suggestions from code review

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

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2025-02-24 17:02:03 +00:00
Lucas Oliveira
e8d2635e1c
fix: disable resizing in TextModal (#6718)
* Created resizable parameter in TextEditorArea

* Changed resizable to false in TextModal
2025-02-24 16:40:06 +00:00
github-actions[bot]
e0b1c63c1b
chore: update test durations (#6778)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2025-02-24 14:01:40 -03:00
Mendon Kissling
a24d3830e4
docs: nvidia ingest integration (#6735)
* initial-nvidia-ingest-content

* image

* image

* complete-flow

* numbers

* delete-superfluous-image

* update-screenshot-shrink-table

* docs: Update NVIDIA Ingest documentation with global variable instructions

* caps

* Apply suggestions from code review

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

* comments-from-code-review

* fix: clarify NVIDIA Ingest component description and instructions

* more-on-outputs

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-24 16:26:21 +00:00
Lucas Oliveira
dfd4a09620
fix: formatted dataframe output in chatoutput (#6717)
* Updated Chat Output to handle Dataframe without displaying other metadata

* Updated starter examples

* [autofix.ci] apply automated fixes

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

* Reverted change to allow md table to be displayed

* Added html support to md renderer

* added min width to markdown tables

* Fixed chat component markdown rendering

* Fixed starter examples

* [autofix.ci] apply automated fixes

* Updated versions

* Fixed rehypeRaw

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* fix: update get_all_flows_similar_to_project function signature and return type

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-24 15:38:49 +00:00
Deon Sanchez
74b273f36b
fix: Improve table column styling in edit node modal (#6763)
* fix: Improve table column styling in edit node modal

* fix: Remove extra space in "Field Name" header
2025-02-21 20:38:31 +00:00
nicholas-johnson-techxcel
e82c21825b
fix: updated ChatOutput component not working with streaming enabled (#6747)
* fix: updated ChatOutput component not working with streaming enabled (#6744)

fixes: 69df913a14

Updated to handle the forgotten Generator case for self.input_value (encountered when streaming is enabled).

Overhauled the chat.py under outputs to (mostly) pass strict type checking, something which could have prevented this bug.

Only this file has been changed. The only type errors in this file are in the safe_convert function and are due to problems in other files.

To prevent further problems in the future, the project should work towards enabling strict type checking permanently after fixing the vast number of type problems.

* [autofix.ci] apply automated fixes

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

* update templates and make sure they support streaming without making breaking chnages

* update templates

* [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-02-21 19:57:49 +00:00
tianzhipeng
4ef4c93bac
fix: don't init langwatch if not configure (#6749)
* fix: don't init langwatch if not configure;

* feat: return langfuse callback for tracing

* fix: move condition to setup_langwatch

* fix: typo

---------

Co-authored-by: tianzhipeng-jk <tianzhipeng-jk@360shuke.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-21 18:48:04 +00:00
Deon Sanchez
feff8b681e
feat: Add loading state and skeleton UI for FlowPage sidebar (#6738)
* feat: Add loading state and skeleton UI for FlowPage sidebar

* fix: Improve UI components with minor styling and z-index adjustments

* refactor: Simplify SkeletonGroup component and update FlowPage sidebar loading state

* refactor: Adjust SkeletonGroup rendering and FlowPage sidebar styling

* refactor: Remove z-index from PageComponent loading state

* refactor: Update FlowPage sidebar skeleton height class
2025-02-21 18:43:00 +00:00
Gabriel Luiz Freitas Almeida
d545e8d302
chore: Update Docker build workflow for reliability improvements (#6760)
* fix: Update Docker build workflow to use Wandalen/wretry.action for improved reliability

* fix: Remove attempt limit and delay from Docker build workflow

* fix: Add comment to clarify provenance setting in Docker build workflow
2025-02-21 18:33:50 +00:00
Gabriel Luiz Freitas Almeida
51e3121d03
fix: Add log_package_version_task attribute to TelemetryService (#6758) 2025-02-21 13:54:26 -03:00
Gabriel Luiz Freitas Almeida
8c7eb57fd0
fix: use async thread in list files (#6754) 2025-02-21 11:42:01 -03:00
Gabriel Luiz Freitas Almeida
3940e8a94a
fix: Enhance tests and update NVIDIA Ingest installation instructions (#6753) 2025-02-21 11:05:29 -03:00
Christophe Bornet
0886bdad16
feat: Use pyproject standardized dependency-groups (#6689)
* Use pyproject standardized dependency-groups

* fix: update Python version requirement to support up to 3.14

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-20 20:19:45 +00:00
Jordan Frazier
400572342f
feat: add nvidia ingest component (#6333)
* initial

* cleanup

* [autofix.ci] apply automated fixes

* ruff

* add else

* update deps

* uv lock

* Make nv-ingest an optional dep

* revert change to validate

* rebase fixes

* [autofix.ci] apply automated fixes

* Update language

* add extra args to make target

* [autofix.ci] apply automated fixes

* update error language

* lockfile update

* rebase lockfile:

* [autofix.ci] apply automated fixes

* Adds nv-ingest by default to -ep docker image

* caps fixes

* update uv lock

* revert ruff upgrade

* ruff

* Fix lint

* [autofix.ci] apply automated fixes

* No code changes made.

* fix: update ruff configuration to ignore additional linting rule and allow built-in modules

* fix: update ruff command to ignore linting rule A005 during autofix

* fix: update Ruff check command to ignore linting rule A005

---------

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-02-20 19:26:03 +00:00
Christophe Bornet
41edba73c9
feat: Add support for Python 3.13 (#6685) 2025-02-20 18:13:21 +00:00
Edwin Jose
60b2e76283
fix: templates with broken connection (#6731)
update to templates
2025-02-20 18:11:19 +00:00
Edwin Jose
18df0e8637
feat: update Structured output to handle Dataframe and inbuilt Prompt (#6642)
* Structured Output

* update

* [autofix.ci] apply automated fixes

* updates

* [autofix.ci] apply automated fixes

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

* Update structured_output.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* update in Templates and added inline edit to the component table inputs

* format fix

* [autofix.ci] apply automated fixes

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

* Update Financial Report Parser.json

* Update Portfolio Website Code Generator.json

* update as per review

* [autofix.ci] apply automated fixes

* update to templates

* fix breaking change

* lint and format error fix

* [autofix.ci] apply automated fixes

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

* [autofix.ci] apply automated fixes

* updated file

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-20 18:11:00 +00:00
Christophe Bornet
a4355caabe
feat: Fix Python versions used in CI (#6725)
fix: Fix Python versions used in CI
2025-02-20 11:15:05 +00:00
Cristhian Zanforlin Lousa
af2d77d886
fix: Simplify loop stopping condition to prevent off-by-one errors (#6696)
* 🐛 (loop.py): Fix logic in LoopComponent to correctly evaluate if loop should stop based on current index and data length
📝 (LoopTemplate.json): Update output_types to be arrays for consistency and readability in LoopTemplate JSON file

* 🐛 (loop.py): fix logic in stop condition to correctly evaluate if loop should stop or continue based on current index and data length

* [autofix.ci] apply automated fixes

*  (loop-component.spec.ts): update test expectation to match the correct number of occurrences of "modified_value" in the output

---------

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-02-20 00:20:23 +00:00
Cristhian Zanforlin Lousa
114c25ecae
feat: Enhance component update system with edge validation alerts (#6716)
 (PageComponent/index.tsx): Refactor UpdateAllComponents rendering logic to improve readability and maintainability
🔧 (UpdateAllComponents/index.tsx): Add error messages as constants for better code organization and reusability
♻️ (UpdateAllComponents/index.tsx): Refactor UpdateAllComponents to use useRef and useMemo hooks for better performance and edge case handling
2025-02-20 00:02:00 +00:00
Eric Hare
02617ffad2
fix: restore default Vector Store RAG key variables (#6721)
* fix: restore default Vector Store RAG key variables

* Update Vector Store RAG.json
2025-02-19 21:28:30 +00:00
Edwin Jose
e8529eaecb
feat: add support to accept Dataframe as input to split text, and added relevant tests (#6302)
* update to support dataframe

* [autofix.ci] apply automated fixes

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

* Update split_text.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* update names

* Update src/backend/base/langflow/schema/dataframe.py

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

* [autofix.ci] apply automated fixes

* update to template

* update review changes

* Update Vector Store RAG.json

* fix lint errors

* fix tests

* 📝 (freeze.spec.ts): update test description to match the actual element being tested for better clarity and accuracy

*  (stop-button-playground.spec.ts): improve test reliability by specifying target position for drag action to prevent flakiness

*  (logs.spec.ts): increase timeout from 1000ms to 3000ms for better test reliability
 (stop-building.spec.ts): update test selector from "handle-splittext-shownode-data inputs-left" to "handle-splittext-shownode-input documents-left" for accurate testing
 (starter-projects.spec.ts): add a 1000ms timeout before asserting visibility of an element for better test stability

---------

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: cristhianzl <cristhian.lousa@gmail.com>
2025-02-19 20:40:56 +00:00
Jakub Kopecký
b43bf8f783
feat: add apify actors integration (#5862)
* initial apify actor component version

* clean code mess

* add apify integrations docs page, manual tests protocol, remove temp scripts

* fix lint type issue

* fix lint and format issues

* rename run_actor.py to apify_actor.py

* actor -> Actor

* update component description and docs link

* add wcc link

* refactor _get_actor_input_schema_from_build

* actor_input -> run_input

* refactor - make suitable methods static

* static methods remove _ before name, docs actor_input -> run_input

* update docs image

* improve docs

* fix typos, rename test .md to run_actor.md

* remove the actor link, that is not clickable

* rename ApifyRunActor -> ApifyActors, improve docs

* code refactor, added concrete examples

* take input_schema arg instead of build

* fix typo

* add custom user-agent

* remove beta label

* Update docs/docs/Integrations/Apify/integrations-apify.md

Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>

* toolify_actor_id_str -> actor_id_to_tool_name

* add simple flow example withtou an agent, removed actor list, added simple how to

* fix typos

* improve how-to section

* remove usege from the component section

* improve example flows section

* remove unnecessary sentence

* format

* fix submodel serialization

* LCToolComponent -> Component

* flatten output remove question mark

* add actor run logs to component logs

* fix grammar, typos and docstrings

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-02-19 19:10:26 +00:00
Edwin Jose
69df913a14
feat: updated ChatOutput component that can accept Data, Dataframe and Message (#6643)
* update chatoutput

* [autofix.ci] apply automated fixes

* update

* tests

* [autofix.ci] apply automated fixes

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

* Update chat.py

* update template

* fix lint errors

* [autofix.ci] apply automated fixes

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

* fix: rename variable for clarity in chat output component test

* [autofix.ci] apply automated fixes

* fix: enable loading from database for API key in starter project configurations

* update templates

* [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>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-02-19 17:48:28 +00:00
Mendon Kissling
d143fe4939
docs: add-xai-component (#6714)
* add-xai-component

* docs: update xAI component documentation with Grok link
2025-02-19 17:34:49 +00:00
Raphael Valdetaro
e970cdbca3
feat: add xAI integration (#6012)
* feat: add xAI integration

* fix: implement file_names_mapping fixture in test_xai.py aligning with test standards

* [autofix.ci] apply automated fixes

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

* fix: remove unused variable in test_xai

* refactor: update input types and variable naming

* [autofix.ci] apply automated fixes

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* Update src/backend/tests/unit/components/models/test_xai.py

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* [autofix.ci] apply automated fixes

* Update xai.py

* test: update test_xai to use MessageTextInput and base_url

* fix: add missing component_class parameter to test_build_model_error

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-02-19 14:28:46 +00:00
Mendon Kissling
770c1b3528
ci: change docs build to use yarn (#6700)
* ci: Update GitHub Actions workflow to use Yarn instead of npm

* chore(deps): Update terser and terser-webpack-plugin dependencies in yarn.lock

* chore(deps): Update Docusaurus dependencies to version 3.7.0
2025-02-19 14:23:35 +00:00
yihong
3b38c2efb7
fix: aws docker file is now in different place (#6706)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2025-02-19 14:22:58 +00:00
Mendon Kissling
eb8db05634
docs: replace mendable with algolia (#6694)
* add-algolia-to-config

* remove-mendable-search-bar

* remove-mendable-yarn-lockfile

* yarn-lockfile

* replace-mendable-in-footer-component

* Update yarn.lock to use Yarn registry URLs

* lockfile-use-npm-registry
2025-02-18 21:06:56 +00:00
Mendon Kissling
1c6e08de64
docs: add log file location and configuration instructions (#6699)
docs: update concepts overview with log file location and configuration instructions
2025-02-18 21:06:28 +00:00
Eric Hare
bc1210a584
fix: Creation of collections in dev Astra DB (#6698)
* fix: Creation of collections in dev Astra DB

* [autofix.ci] apply automated fixes

* Update astradb.py

* [autofix.ci] apply automated fixes

* Update astradb.py

* [autofix.ci] apply automated fixes

* Update Vector Store RAG.json

* [autofix.ci] apply automated fixes

* Update vector template

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-18 20:55:33 +00:00
Lucas Oliveira
70bb897a85
fix: added save button to table component to improve consistency (#6663)
* Added onSave and onCancel to tableModal, in order for it to preserve state

* Changed TableNodeComponent to handle temp values and only change value when saved

* 🔧 (tableModal/index.tsx): refactor handleSetOpen and handleOnEscapeKeyDown functions to improve code readability and maintainability

* Fix test that use tableInput

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-02-18 20:50:27 +00:00
Gabriel Luiz Freitas Almeida
b8346a0afa
Refactor: Remove unused imports across multiple frontend components (#6232)
* refactor: Remove unused imports across multiple frontend components

* update outdated components

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-02-18 19:51:38 +00:00
Jordan Frazier
45bac3714a
feat: add db driver env variable (#5967)
* Add option to disable prepared statements

* [autofix.ci] apply automated fixes

* use generic connection driver env var

* simplify and allow usage for sqlite

* allow pool class to be set to kwargs

* simplify pool class selection

* [autofix.ci] apply automated fixes

* use reflection to get poolclass

* rebase fixes

* [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-02-18 17:03:07 +00:00
Gabriel Luiz Freitas Almeida
25ac555e8f
refactor: Improve API key decryption error logging (#6193)
refactor: improve API key decryption error handling and logging
2025-02-18 15:32:14 +00:00
Cristhian Zanforlin Lousa
73d2b2f9af
chore: fix capitalization of "Open Playground" in default shortcuts (#6687)
 (constants.ts): capitalize the display name and name of the "Open Playground" shortcut for consistency and better readability
2025-02-18 14:59:25 +00:00
Raphael Valdetaro
19ed8bfc5f
feat: Add YouTube Video Analysis Template (#6245)
* feat: Add YouTube Video Analysis Template

* feat: enhance YouTube analysis metadata with description, icon and tags

* fix: add routing validation component for URL and YouTube input

* remove: duplicated youtube analysis.json from starter projects

* refactor: improve descriptions and formatting in YouTube Analysis JSON

* fix: update YouTube Analysis starter project API key configuration

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-18 14:57:01 +00:00
Gabriel Luiz Freitas Almeida
1530e61669
feat: add functionality to stream or poll events from the build process (#5940)
* refactor: simplify TaskService by removing Celery integration

* refactor: enhance AnyIO backend task management and error handling

* refactor: restructure flow building process and enhance event handling

* feat: implement QueueService for managing job queues and tasks

* feat: Add QueueService for managing job queues and task lifecycle

* feat!: Enhance flow building with QueueService integration for job management

* revert changes to async session

* feat: Integrate QueueService into lifespan management for task handling

* refactor: Enhance QueueService with robust lifecycle management and cleanup mechanisms

* refactor: Simplify docstring for get_queue_service function

* refactor: Update import statements in queue factory for clarity

* test: Improve chat endpoint tests with comprehensive build flow scenarios

* refactor: Streamline flow build event generation and queue management

* refactor: Improve flow build process with modular event handling and URL parameter management

* test: Enhance loop component tests with flow build and event handling utilities

* fix: Improve transaction logging with null flow_id handling and debug logging

* fix: Remove unnecessary db.refresh() in transaction logging

* feat: Add polling mode for build events with optional streaming

* feat: Add event delivery configuration option to settings

* feat: Implement polling for build events with configuration-driven streaming

* refactor: Enhance queue cleanup with improved logging and error handling

* test: Improve build event stream assertion with detailed error reporting

* test: Add benchmark test for build flow polling mechanism

* refactor: Remove redundant end event in flow event generation

* test: Update test_component_tool_with_api_key to use async flow

* Convert test method to async
* Update graph start method to use async_start()
* Add client parameter to test method
* Modify tool retrieval to use async method

* test: Add session ID generation in agent component test

* fix: Enhance error handling in LCAgentComponent for ExceptionWithMessageError

Add null checks to prevent potential AttributeError when handling agent message deletion

* test: Refactor test assertion for model name options in agent component

Simplify the assertion for checking "sonnet" in model name options by extracting the options to a variable first

* refactor: Improve type hints and imports in AnyIOTaskResult

* Add `__future__` import for type annotations
* Use conditional import for `Callable` and `TracebackType`
* Explicitly type `_traceback` attribute with `TracebackType | None`

* fix: Add null checks for event task in build events streaming

* refactor: Extract build and disconnect handling into separate modules

This commit separates the build and disconnect handling logic from the chat API module into dedicated files:

- Created `langflow/api/build.py` to house the flow generation and vertex building logic
- Created `langflow/api/disconnect.py` to manage the custom streaming response with disconnect handling
- Removed duplicate code from `langflow/api/v1/chat.py`
- Improved code organization and modularity

* refactor: Extract flow build and event handling methods in build API

This commit introduces two new methods in the build API to improve code organization and reusability:

- `start_flow_build()`: Centralizes the logic for creating a queue and starting a flow build task
- `get_flow_events_response()`: Handles retrieving flow events for both streaming and polling modes

The changes simplify the chat API endpoint implementations and reduce code duplication

* refactor: Deprecate /task endpoint and add informative error message

This commit marks the /task endpoint as deprecated and raises an HTTP 400 error with a clear message indicating the endpoint will be removed in a future version. The changes improve API clarity and guide users towards the recommended /run endpoint.

* refactor: Update log_transaction function return type annotation

Modify the return type hint for log_transaction to allow for potential None return, improving type safety and clarity in the transactions logging method.

* feat: Add configurable event delivery streaming option

Introduce support for configurable event delivery mode (streaming/polling) across frontend components:

- Add `shouldStreamEvents()` method in NodeStatus and IOModal
- Update flowStore to accept a `stream` parameter
- Modify buildFlowVerticesWithFallback to use the stream parameter directly
- Remove hardcoded polling logic in buildUtils

* fix: Add null check for flow_id in log_transaction function

Prevent logging transactions without a flow_id by returning None, ensuring data integrity and avoiding potential database errors

* chore: Update changes-filter to include chat API path

* fix: Add error handling and null checks in flow transaction deletion

Improve robustness of transaction and vertex build deletion by:
- Adding a null check for flow_id in delete_transactions_by_flow_id
- Wrapping deletion operations in try-except blocks to prevent failures
- Logging debug messages for any deletion errors

* fix: Remove redundant commit in vertex builds deletion

Remove unnecessary db.commit() from delete_vertex_builds_by_flow_id to prevent duplicate commits and simplify database transaction handling

* fix: Improve transaction logging with debug message and return value

Move debug logging from CRUD layer to utils to provide more context about logged transactions and ensure proper error handling

* fix: Improve error handling and transaction cleanup in active_user fixture

Enhance user and transaction cleanup process in test fixture by:
- Adding separate try-except blocks for transaction/vertex build deletion and user deletion
- Adding debug logging for potential errors during cleanup
- Ensuring proper session commits for each operation

* propagate parent task CancelledError instead of supressing it

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* refactor: Rename queue service to job queue service

Restructure job queue management by:
- Renaming QueueService to JobQueueService
- Moving queue-related files to a new job_queue directory
- Updating import paths and service type references
- Enhancing job queue service with more robust async job management

* fix: Correct ServiceType enum reference for job queue service

Update the service type constant to match the recently renamed JobQueueService, ensuring consistent service type referencing across the application.

* refactor: Enhance JobQueueService with comprehensive logging and documentation

Improve the JobQueueService implementation by:
- Adding detailed docstrings with clear explanations of methods and attributes
- Implementing comprehensive logging throughout the service
- Enhancing error handling and logging for queue and task management
- Providing more context in log messages for debugging and monitoring

* docs: Improve stop method docstring for JobQueueService

Enhance the documentation for the stop method by:
- Providing a more detailed and precise description of the shutdown process
- Clarifying the steps involved in gracefully stopping the service
- Improving the explanation of resource cleanup and task cancellation

* fix: Properly handle task cancellation and propagate exceptions in JobQueueService

* fix: Enhance error handling and raise appropriate exceptions in JobQueueService methods

* improve docstring

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* fix: Remove redundant exception raises in JobQueueService methods and improve cleanup logic

* fix: Improve logging during job cleanup and handle exceptions more appropriately

* feat: add utility to run tests with multiple event delivery modes

* feat: integrate withEventDeliveryModes utility in multiple test files

* refactor: replace status code assertions with httpx codes for clarity

* remove noqa comment and change argument name

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>

* refactor: streamline event polling logic in get_flow_events_response

* refactor: use getattr for safer session attribute access

Co-author: @cbornet

* feat: add is_started method to JobQueueService

* refactor: modify JobQueueService start method and main.py queue service initialization

* feat: add ready state and teardown method to JobQueueService

* refactor: simplify job queue cleanup logic in JobQueueService

* refactor: improve error logging in active_user fixture

* refactor: improve AnyIO task management with TaskGroup and CancelScope

* refactor: Implement LimitedBackgroundTasks for controlled vertex build logging (#6312)

* feat: implement LimitedBackgroundTasks for controlled vertex build logging

* refactor: replace BackgroundTasks with LimitedBackgroundTasks in build_flow endpoint

* refactor: improve task cancellation error handling in JobQueueService

* refactor: Rename LimitedBackgroundTasks to LimitVertexBuildBackgroundTasks

* feat: Add EventDeliveryType enum for event delivery methods

* feat: Add polling constants for endpoint and streaming status

* refactor: Update buildFlowVerticesWithFallback to use polling constants

* refactor: Update event delivery handling to use EventDeliveryType enum

* [autofix.ci] apply automated fixes

* fix: Improve error handling for cancelled build tasks

Refactor generate_flow_events to properly handle and propagate CancelledError
- Remove unnecessary task creation and manual cancellation
- Directly await _build_vertex instead of creating a separate task
- Improve exception logging for cancelled tasks
- Ensure CancelledError is raised instead of being silently handled

* fix: trigger event_manager.on_end after error handling in generate_flow_events

---------

Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-18 14:24:39 +00:00
JamalBoustani
868cc4df76
feat: add Olivya's 'Place Call' component (#5917)
* Fixing failed unit tests for Olivya's 'Place Call' component

* Revert "Fixing failed unit tests for Olivya's 'Place Call' component"

This reverts commit abc62c9b9d14129d31b2c73ca0c68b2aba9be0a0.

* Fixing failed unit tests for Olivya's 'Place Call' component

* Update src/backend/base/langflow/components/olivya/olivya.py

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

* Update src/backend/base/langflow/components/olivya/olivya.py

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

* Remove unused logging import in Olivya component

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-18 13:45:22 +00:00