Commit graph

13,867 commits

Author SHA1 Message Date
Ítalo Johnny
48676b0cbc
fix: add check for variable value before calling method (#3868) 2024-09-20 17:52:41 -03:00
Mendon Kissling
4d76dd95c5
Docs: memories components (#3852)
* restart

* initial-content
2024-09-20 15:01:42 -04:00
Mendon Kissling
b9524f8ce7
docs: tools components (#3850)
content
2024-09-20 17:23:04 +00:00
Christophe Bornet
6f0b6830d2
feat: Add format option with raw HTML to URL component (#3762)
Add format option with raw HTML to URL component

Co-authored-by: Nadir J <31660040+NadirJ@users.noreply.github.com>
2024-09-20 10:59:00 -04:00
Gabriel Luiz Freitas Almeida
667713f6c0
fix: add run_id parameter to set run ID in graph and handle exceptions in FlowTool (#3855)
* Add run_id setting to FlowTool with warning on failure

* feat: Add try-except block to set run_id in FlowTool

The try-except block is added to handle any exceptions that may occur when setting the run_id in the FlowTool class. If an exception occurs, a warning is issued and the run_id is set to None. This ensures that the code does not break if there is an error in setting the run_id.
2024-09-19 13:31:38 -07:00
Gabriel Luiz Freitas Almeida
4a518307b7
fix: refactor FlowTool to use run_until_complete for async flow execution (#3845)
Refactor `FlowTool` to use `run_until_complete` for async flow execution
2024-09-19 15:05:52 -03:00
Ítalo Johnny
aaa5cef20a
fix: duckduckgo-search (#3857) 2024-09-19 14:09:47 +00:00
Eric Hare
f6d93fc472
feat: Move vectorize to Astra DB Component (#3766)
* Move vectorize to Astra DB Component

* [autofix.ci] apply automated fixes

* Ruff check fixes

* Update compatibility tests and add new tests

* [autofix.ci] apply automated fixes

* Fixes from review feedback

* Restore old vectorize component, add deprecation label

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-19 06:11:31 -07:00
Cristhian Zanforlin Lousa
98c1f0e8aa
fix: fix building loop when renaming a folder and opening a new flow and running It (#3844)
* refactor: Add useIsFetching hook for folder fetching in DropdownButtonComponent

* refactor: Improve folder sidebar buttons component

Refactor the folder sidebar buttons component to improve its structure and readability. This includes adding a new hook for folder fetching, handling rendering and filtering functionality, and updating the UI for adding and uploading folders. The changes also include handling double-click and keydown events for folder items, as well as fixing some bugs related to folder editing and deleting. These improvements enhance the overall user experience and maintainability of the codebase.

* refactor: Remove unused import and variable in DropdownButtonComponent

* refactor: Remove unused import and variable in DropdownButtonComponent

- Remove unused import and variable in DropdownButtonComponent
- Add useIsFetching hook for folder fetching in DropdownButtonComponent

* refactor: Remove unused import and variable in DropdownButtonComponent
2024-09-18 20:13:47 -03:00
Cristhian Zanforlin Lousa
323d5142b8
fix: Add Cascade Delete Function for Transactions and Builds Associated with Flows (#3848)
* refactor: Add cascade delete functionality for flows

This commit adds a new function `cascade_delete_flow` to the `utils.py` file in the `langflow.api` module. This function is responsible for deleting related records when a flow is deleted. It uses the `delete` method from SQLAlchemy to delete records from the `TransactionTable` and `VertexBuildTable` tables based on the flow ID. Finally, it deletes the flow record itself from the `Flow` table.

The function is wrapped in a try-except block to handle any exceptions that may occur during the deletion process. If an exception is raised, a `RuntimeError` is raised with an appropriate error message.

This refactor improves the code by encapsulating the cascade delete logic in a separate function, making it more modular and easier to maintain.

* refactor: Add cascade delete functionality for flows

* refactor: Add cascade delete functionality for flows and folders

* refactor: Remove unused delete_flow_by_id function

* refactor: Add cascade delete functionality for flows and folders

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-18 17:51:01 +00:00
Jordan Frazier
14b6157b1d
ci: remove unnecessary ref checkout for nightly tests (#3847)
Remove unnecessary ref checkout for nightly tests
2024-09-18 09:49:55 -07:00
Sebastián Estévez
88443932c1
chore: bump astra-assistants to v2.1.2 (#3841)
bump astra-assistants to v2.1.2
2024-09-18 11:20:04 -04:00
Cristhian Zanforlin Lousa
53c99e9857
fix: xml component working properly (#3822)
* 📝 (XMLAgent.py): Add support for chat history data input in XMLAgentComponent to enhance agent functionality and interaction with Language Model.

* [autofix.ci] apply automated fixes

* 📝 (XMLAgent.py): Update user_prompt to system_prompt and adjust its content for better clarity and consistency
🐛 (XMLAgent.py): Ensure user_prompt contains 'input' key before creating agent runnable to prevent errors

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-18 07:56:58 -07:00
Lucas Oliveira
bad009c0fa
fix: update project description, update alerts animation, fix delete and duplicate loading (#3835)
* Deleted "personal" from manage your projects

* Removed animations from alerts on the dropdown

* Changed useDeleteFlow to return isPending as well

* Added delete loading to components and added filter of components not present in "flows" for deletion

* added isDuplicating as a isMutating with the postAddFlow
2024-09-18 13:30:49 +00:00
Jordan Frazier
a7d1449e9d
ci: tag fixes and robustness to workflow failures (#3838) 2024-09-17 18:03:48 -07:00
Christophe Bornet
f17de26ab0
fix: Fix Text Splitters (#3783)
* fix: Fix Text Splitters

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-17 23:45:38 +00:00
Cristhian Zanforlin Lousa
8c8be151e5
feat: add duckduckgo search component (#3798)
* 🔧 (pyproject.toml): add duckduckgo-search dependency to the project
 (DuckDuckGoSearchRun.py): introduce DuckDuckGoSearchComponent for performing web searches using DuckDuckGo search engine
 (DuckDuckGo.jsx): add SVG icon for DuckDuckGo
 (index.tsx): create DuckDuckGoIcon component for displaying DuckDuckGo icon
🔧 (styleUtils.ts): import DuckDuckGoIcon for nodeIconsLucide in styleUtils

* 📝 (DuckDuckGoSearchRun.py): remove unnecessary whitespace to improve code readability and consistency

*  (DuckDuckGoSearchRun.py): Add retry logic to DuckDuckGo search component for rate-limited requests
📝 (DuckDuckGoSearchRun.py): Update component description to reflect the addition of retry logic
📝 (DuckDuckGoSearchRun.py): Add new inputs for max_retries and initial_delay to configure retry behavior
📝 (DuckDuckGoSearchRun.py): Update search_response method to use search_with_retry method with retry logic
📝 (DuckDuckGoSearchRun.py): Update format_results method to handle formatted results
📝 (DuckDuckGoSearchRun.py): Add search_with_retry method to handle search with retry logic
📝 (DuckDuckGoSearchRun.py): Update search_response method to use search_with_retry method
📝 (DuckDuckGoSearchRun.py): Update search_response method to set status messages
📝 (DuckDuckGoSearchRun.py): Handle exceptions and set appropriate status messages in search_response method
 (duckduckgo.spec.ts): Add integration test for DuckDuckGo search component in frontend

* 📝 (DuckDuckGoSearchRun.py): add newline at the end of the file to follow best practices and avoid potential issues with some tools that expect it

* [autofix.ci] apply automated fixes

* updating duckudckgo

* [autofix.ci] apply automated fixes

*  (DuckDuckGoSearchRun.py): Refactor DuckDuckGoSearchComponent to use pydantic BaseModel for schema definition and improve code structure for better readability and maintainability. Add support for result limiting in search functionality.

* 🔧 (DuckDuckGoSearchRun.py): Remove unnecessary import and update status message for DuckDuckGo Search Tool to improve clarity

* [autofix.ci] apply automated fixes

*  (duckduckgo.spec.ts): update test selectors for duckduckgo search component to match changes in the frontend code and improve test reliability

* 🐛 (linkComponent.spec.ts): fix an issue where the key combination for selecting all text was not working correctly on Mac devices. Updated the key combination to use the correct modifier key based on the user's operating system.

* 📝 (frontend): mark is-unicode-supported package as extraneous in package-lock.json

* rollback lock file

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-17 16:39:17 -03:00
Gabriel Luiz Freitas Almeida
50f9f72f5f
feat: Add run_id parameter to run_flow function (#3834)
* Add run_id parameter to set run ID in graph within load_and_run_flow function

* Add run_id parameter to run_flow call in FlowTool for tracking runs

* Add run_id parameter to CustomComponent's run_flow method

* fix: mypy error arg-type

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-17 15:35:22 -03:00
Cristhian Zanforlin Lousa
3e617acf2f
feat: Add New Link Parameter Type for External Links in Node UI (#3806)
*  (inputs/__init__.py): Add LinkInput class to support linking functionality in inputs
📝 (inputs/input_mixin.py): Add Link field type to support linking functionality in inputs
📝 (inputs/inputs.py): Add LinkInput class to support linking functionality in inputs
📝 (io/__init__.py): Import and export LinkInput class for linking functionality in inputs
📝 (frontend/src/components/linkComponent/index.tsx): Create LinkComponent to display and handle links in frontend components
📝 (frontend/src/components/parameterRenderComponent/index.tsx): Add support for rendering LinkComponent in parameter rendering based on template type
📝 (frontend/src/constants/constants.ts): Add "link" as a supported type for LANGFLOW_SUPPORTED_TYPES
📝 (frontend/src/types/api/index.ts): Add icon and text fields to InputFieldType for link component
📝 (frontend/src/types/components/index.ts): Define LinkComponentType for passing link data to LinkComponent

 (linkComponent.spec.ts): Add unit test for link component interaction to ensure proper functionality and behavior
📝 (unit-test-components.spec.ts): Add template for a unit test file to be used for testing components in the frontend application

* style: apply make format

* Update input_mixin.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-17 16:56:10 +00:00
Mike Fortman
d4bed03f9c
refactor: Move to LoadEnv in vite config (#3825)
use loadenv
2024-09-16 14:34:59 -05:00
Lucas Oliveira
3e11d8a64d
fix: vite config and routes to support no slashes, and api interceptor for fetch (#3824)
* Fix vite config and routes to support no slashes

* Added fetch intercept to add custom headers into fetch calls
2024-09-16 18:42:08 +00:00
Lucas Oliveira
2f1f1808b9
refactor: handle rendering and filtering functionality (#3512) 2024-09-13 17:27:30 -03:00
Mike Fortman
2bd5d4b911
feat: Update tracking (#3805)
* Update tracking

* [autofix.ci] apply automated fixes

* cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-13 13:01:06 -05:00
Lucas Oliveira
56802bada6
refactor: add custom banner and refactor pagelayout to include it (#3803)
* Added custom banner

* Refactored pageLayout to include custom banner
2024-09-13 17:29:19 +00:00
Lucas Oliveira
35c194e575
fix: json dark mode colors and dict component button view (#3802)
* Fix dark mode colors on jsonView

* Fix dict component button view

* Changed style of dict component button

* Changed parameter render to remove space on the bottom of the inputs that are only handles

* Fixed space below nodes
2024-09-13 16:34:58 +00:00
Cezar Vasconcelos
b570f9695d
feat: notion-documentation (#3767)
* docs: add notion category and setup file

* docs: Add Notion Agent Meeting Notes documentation

* docs: Remove unused anchors in Notion guide

* docs(Notion): Add guide for Conversational Notion Agent

* feat: add notion example flows

* cleanup

* build and run

* align-pages

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2024-09-13 13:17:52 -03:00
Mendon Kissling
eb3bf824a3
docs: update components (#3756)
* prompts

* data-components

* embedding-models

* helpers

* vector-stores

* models

* vectara-rag

* io

* cleanup-prompts

* hub-prompt

* escape-chars
2024-09-13 15:22:24 +00:00
Mendon Kissling
44deb61d7f
docs: custom components (#3784)
* content

* content

* examples-work

* contribute
2024-09-13 15:05:01 +00:00
Cristhian Zanforlin Lousa
612dc7f5ef
fix: remove log from csvAgent component (#3800)
* 🐛 (CSVAgent.py): Fix handle_parsing_errors parameter to use the correct instance variable self.handle_parsing_errors instead of a hardcoded value

* 📝 (CSVAgent.py): add newline at the end of the file to follow best practices and improve code readability
2024-09-13 14:43:55 +00:00
Lucas Oliveira
cc04a21d9c
fix: frozen border (#3801)
Fix frozen border
2024-09-13 14:40:41 +00:00
Cristhian Zanforlin Lousa
fc23de67e4
fix: JSONViewer component style update to fits on dark and light mode (#3792)
*  (frontend): Add react-json-view-lite package to frontend dependencies
📝 (frontend): Update JsonView component in dictAreaModal to use dark theme and adjust class name
📝 (frontend): Update background color for dark theme in JsonView component styling

* 🔧 (generalBugs-shard-13.spec.ts): remove unnecessary line causing linting issue

* updating lock
2024-09-13 14:37:59 +00:00
Cristhian Zanforlin Lousa
e44479fb16
fix: update csvAgent to work as expected (#3790)
*  (CSVAgent.py): Add support for MessageTextInput input type and Output for building agent response
📝 (CSVAgent.py): Update input descriptions and add info for better understanding of inputs
📝 (CSVAgent.py): Update build_agent_response method to handle input and return response as a Message object
📝 (CSVAgent.py): Update build_agent method to return Union[AgentExecutor, Agent] for flexibility and handle parsing errors

* [autofix.ci] apply automated fixes

* fix: remove Union from func return type

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-12 20:03:05 +00:00
Cristhian Zanforlin Lousa
5b51fe892b
fix: adjust invoke agent to work sync (#3789)
♻️ (agent.py): refactor the code to remove unnecessary 'await' keyword before agent.invoke() method to improve code readability and maintainability
2024-09-12 19:58:41 +00:00
Edwin Jose
82753064cb
feat: Enhance HuggingFace Embeddings Inference component (#3758)
# Enhance HuggingFaceInferenceAPIEmbeddings component

## Initial enhancements
- Update display name and description for clarity
- Add API URL validation method
- Implement local URL detection and dummy API key for local deployments
- Improve error handling for API key and URL requirements
- Update documentation link

## API key info update
- Updated the info in API key input

## Refactor and improvements
- Update base class from LCModelComponent to LCEmbeddingsModel
- Rename 'api_url' to 'inference_endpoint' for clarity
- Improve error messages and validation for inference endpoint
- Update documentation link
- Enhance comments and code formatting
2024-09-12 19:55:55 +00:00
Lucas Oliveira
128a0e9332
fix: update flow name validation and label (#3785)
* Changed text warning name invalid

* Change invalidNameList to include components

* 📝 (generalBugs-shard-13.spec.ts): add missing comments to clarify the purpose of the code block and improve code readability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-12 19:47:21 +00:00
Jordan Frazier
1ea42725a4
ci: adds step to push to ghcr (#3779) 2024-09-12 09:23:04 -07:00
Shreyas Damle
dc908673de
Docs: Update getting-started-quickstart.md (#3780)
* Update getting-started-quickstart.md

* use-relative-links

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2024-09-12 14:28:31 +00:00
Ítalo Johnny
f18c4e9079
chore: bump langflow versions (#3765) 2024-09-11 19:20:13 -03:00
Cristhian Zanforlin Lousa
50612e62ac
fix: change the default value of inputComponent on Simple Agent (#3771)
* changing the example default input value

* Update Agent Flow.json

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-11 19:02:54 -03:00
anovazzi1
92f59ab9e0
featur: Add CalculatorToolComponent (#3772)
* feat: Add CalculatorToolComponent to langflow/components/tools

This commit adds the CalculatorToolComponent to the langflow/components/tools directory. The CalculatorToolComponent allows users to perform basic arithmetic operations on a given expression. It includes an input for the expression and returns the result or an error message.

Ref: #3757

* lint

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-11 21:48:24 +00:00
Cristhian Zanforlin Lousa
2652f44d31
fix: share button not working on canvas (#3770)
🔧 (utils.py): refactor import statement to get version info from utils module instead of version module
🔧 (index.tsx): add dataTestId attribute to submit button in ShareModal component for testing purposes
 (generalBugs-shard-13.spec.ts): add end-to-end test to verify sharing a flow on the Langflow Store via modal interaction
2024-09-11 21:39:16 +00:00
anovazzi1
0ded882b74
fix: Update @radix-ui/react-dialog to version 1.1.1 (#3769) 2024-09-11 21:21:25 +00:00
Ítalo Johnny
7dcf639f7c
fix: bug langchain await (#3775)
* fix: TypeError: object LangfuseResponseGeneratorSync can't be used in 'await'

* 🔧 (generalBugs-shard-1.spec.ts): remove unnecessary empty line to improve code readability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-11 18:03:32 -03:00
Christophe Bornet
7273a6e78a
feat: Add CassandraGraphVectorStoreComponent and HtmlLinkExtractorComponent (#3757)
* Add CassandraGraphVectorStoreComponent and HtmlLinkExtractorComponent

* Move uuid import to global imports

* fix test with new text spliter

* update poetry lock

* ci: add continue-on-error to py_autofix.yml

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-11 14:56:25 -03:00
anovazzi1
810cf72487
fix: Update templates and include global variables (#3755)
* update templates

* update to include global variables

* Refactor code to include global variables

* update PythonREPLTool.py

* [autofix.ci] apply automated fixes

* update pythonREPL and example

* Refactor code to handle decoding chat messages and handle decoding errors

*  (Simple Agent.spec.ts): Add test case to fill textarea with specific text for testing purposes
📝 (Simple Agent.spec.ts): Update test case descriptions for better clarity and accuracy
 (Simple Agent.spec.ts): Update test assertions to match the expected behavior of the test case

* [autofix.ci] apply automated fixes

* 🐛 (Dynamic Agent.spec.ts): fix environment variable name from BRAVE_SEARCH_API_KEY to SEARCH_API_KEY for consistency and clarity
💡 (Dynamic Agent.spec.ts): add additional test cases to improve test coverage and ensure specific text is not present in the chat output

* 🔧 (.github/workflows/typescript_test.yml): update environment variable name from BRAVE_SEARCH_API_KEY to SEARCH_API_KEY for consistency
🐛 (Travel Planning Agent.spec.ts): fix test to skip if SEARCH_API_KEY is not available in the environment variables

*  (Simple Agent.spec.ts): update expected count of python words to 3 for accurate test validation

* updating search tools

* [autofix.ci] apply automated fixes

* change examples

* update travel planning to include global variable

* Refactor search API component to include result limiting

* 📝 (Travel Planning Agent.spec.ts): remove unnecessary empty line to improve code readability and consistency

* test: adjusts asserts to make the test pass successfully

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-11 14:47:42 +00:00
Cristhian Zanforlin Lousa
9b5c16a0ec
tests: update astraDB test to ensure will run dev mode only when necessary (#3754)
* 📝 (Vector Store.spec.ts): Remove unnecessary code block related to AstraVectorStoreComponent class and its methods
♻️ (Vector Store.spec.ts): Refactor test file to remove unused imports and clean up unnecessary code blocks

🔧 (Vector Store.spec.ts): Refactor code to include conditional logic based on the presence of "dev" in ASTRA_DB_API_ENDPOINT environment variable
🔧 (Vector Store.spec.ts): Add function extractAndCleanCode to extract and clean code content from HTML element

* 🐛 (Vector Store.spec.ts): fix incorrect check for Astra DB API endpoint to include "astra-dev" instead of "dev" for proper environment detection
2024-09-10 17:29:37 -03:00
anovazzi1
b6df370fcc
fix: Refactor usePatchUpdateFlow mutation to include refetchQueries (#3736)
* refactor: Add refetchQueries to usePatchUpdateFlow mutation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-10 19:55:58 +00:00
Cristhian Zanforlin Lousa
af99b4c32a
fix: disable add new folder button when isLoading (#3734)
*  (index.tsx): Add ShadTooltip component to provide tooltips for folder buttons for better user experience
📝 (index.tsx): Import useIsFetching from "@tanstack/react-query" to check if there are ongoing data fetching operations before enabling folder buttons

* 🔧 (index.tsx): add isPending variable to usePostFolders hook to track loading state for adding folders
🔧 (index.tsx): update disabled attribute in add and upload folder buttons to include isPending variable to prevent multiple submissions

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-10 19:46:15 +00:00
Cristhian Zanforlin Lousa
6f8beb894f
feat: improve user chat input to display spacements (#3687)
feat: Refactor chatMessage component for improved readability and performance

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-10 19:43:09 +00:00
Cristhian Zanforlin Lousa
96f0ea9db7
tests: update astraDB integration test (#3753)
 (Vector Store.spec.ts): Add AstraVectorStoreComponent to support Astra DB integration for vector storage and search capabilities.
2024-09-10 16:30:16 -03:00