Commit graph

14,870 commits

Author SHA1 Message Date
Raphael Valdetaro
cfaac694dc
refactor: Update WikidataAPI component to standard output pattern (#5431)
* refactor: Update WikidataAPI component to standard output pattern

* [autofix.ci] apply automated fixes

* Fix formatting errors in wikidata_api.py

* fix: Fix linting error in tools init

* test: add unit tests for WikidataComponent

* refactor: rename WikidataComponent to WikidataAPIComponent

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2025-01-07 22:22:54 +00:00
anovazzi1
19a18a090c
Fix: update viewBox dimensions in Langwatch component (#5560)
refactor: Update viewBox dimensions in Langwatch component
2025-01-07 16:44:08 +00:00
anovazzi1
f253246714
Refactor: update selectors in outdated message test (#5079)
* fix: add missing imports and update selectors in outdated message test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-07 16:42:03 +00:00
Gabriel Luiz Freitas Almeida
4ea144eba9
refactor: make StructuredOutput tests to use MockLanguageModel (#5563)
* feat: add MockLanguageModel for testing language model interactions

- Introduced a new mock implementation of BaseLanguageModel to facilitate unit testing.
- Implemented methods to simulate responses and handle message processing.
- Added functionality to generate mock responses based on input messages.
- Ensured compatibility with existing language model interfaces for seamless integration in tests.

* refactor: simplify test_structured_output_component by replacing MagicMock with MockLanguageModel

- Removed extensive mock implementations of BaseLanguageModel in tests.
- Replaced instances of MagicMock with a new MockLanguageModel for better clarity and maintainability.
- Streamlined test cases for structured output generation and error handling.
- Ensured compatibility with existing test structure while enhancing readability.

* fix: rename utils.py to useful.py to avoid namespace conflict

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2025-01-07 15:48:16 +00:00
Gabriel Luiz Freitas Almeida
7084433adc
chore: Update supported versions in tests constants (#5569)
* fix(tests): update supported versions in constants.py to include new releases

- Updated SUPPORTED_VERSIONS to reflect the latest versions: 1.0.19, 1.1.0, and 1.1.1.
- This change ensures that tests are aligned with the most current versioning.

* refactor(tests): update file_names_mapping for input, output, and prompt components

- Removed outdated version entries (1.0.15 to 1.0.18) and added new versions (1.1.0 and 1.1.1) for ChatInput, TextInput, ChatOutput, and Prompt components.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.

* fix(tests): update file_names_mapping in TestTextOutputComponent to reflect new versioning

- Removed outdated version entries (1.0.17, 1.0.18) and added new versions (1.1.0, 1.1.1) for TextOutput component.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.
2025-01-07 15:43:49 +00:00
Gabriel Luiz Freitas Almeida
95314e3fca
tests: allow tests to skip version tests if file_names_mapping is empty (#5562)
fix(tests): update ComponentTestBase to skip tests when file_names_mapping is empty

- Modified the test method to skip the test instead of raising an AssertionError when no file names mapping is provided.
- Improved user feedback by providing a clear message indicating the reason for skipping the test.
2025-01-07 12:47:14 +00:00
Cristhian Zanforlin Lousa
af4fb3774e
feat: Revamp GlobalVariableModal (#5512)
* 📝 (GlobalVariableModal.tsx): Refactor GlobalVariableModal component to use Tabs component instead of Select for type selection and improve layout and styling of input fields and labels
🔧 (index.tsx): Add popoverWidth prop to InputComponent to allow setting the width of the popover in CustomInputPopover component
🔧 (index.tsx): Add popoverWidth prop to InputComponent in InputGlobalComponent to set the width of the popover to 315px

 (tabs-button.tsx): introduce new TabsButton component to handle tab functionality in UI components
📝 (tabs-button.tsx): add documentation for Tabs, TabsContent, TabsList, TabsTrigger components
📝 (components/index.ts): add popoverWidth property to InputComponentType to control the width of the popover in UI components

*  (GlobalVariableModal.tsx): Add ForwardedIconComponent to display an icon next to the modal header text for better visual representation
📝 (GlobalVariableModal.tsx): Update TabsTrigger components to include data-testid attribute for testing purposes

 (index.tsx): Introduce new components OptionBadge, CommandItemContent, and SelectionIndicator to improve code organization and reusability
♻️ (index.tsx): Refactor handleRemoveOption function to have a more descriptive parameter signature and improve readability
📝 (index.tsx): Add comments to clarify the purpose of handleOptionSelect function and improve code documentation
📝 (index.tsx): Add comments to describe the purpose of getInputClassName and getAnchorClassName functions for better code understanding

 (globalVariables.spec.ts): improve placeholder text for variable name and value fields for better user understanding and experience

* 🐛 (GlobalVariableModal.tsx): Fix disabled state logic for TabsTrigger components to correctly reflect initialData type
📝 (GlobalVariableModal.tsx): Update label for submit button to dynamically change based on the presence of initialData

* 🐛 (index.tsx): Fix issue where options were not being correctly memoized as a Set to prevent unnecessary re-renders. Update memoizedOptions to correctly memoize options as a Set.

* 📝 (userSettings.spec.ts): Update placeholder text for variable name and value fields to improve clarity and user experience.
2025-01-07 12:07:08 +00:00
anovazzi1
a142b45160
feat: make Agents not send message if not connected to an output component (#5521)
* Refactor: Commented out  TextInput and TextOutput components

* Refactor: Add function to check if graph has output vertex connected to it

* Refactor: Add function to skip messages based on vertex configuration and message type

* Refactor: Update function to check for chat output in graph vertices

* Refactor: Enhance message skipping logic to include vertex existence check

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-06 21:01:09 +00:00
anovazzi1
a57a49d48d
refactor: prevent tool mode on group component (#5522)
* Refactor nodeToolbarComponent to conditionally show tool mode button based on isGroup variable

* add toolModeGroup.spec.ts test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-06 20:20:37 +00:00
Cristhian Zanforlin Lousa
2ed0b10679
fix(nightly): refactor freeze-path feature test (#5557) 2025-01-06 10:59:29 -08:00
Edwin Jose
89756390e8
fix: uv lock fixes issues from crosshair-tool versions (#5535)
Update uv.lock
2025-01-03 19:27:22 +00:00
Mendon Kissling
cd6dfc20e3
fix: remove duplicate Components section from sidebar (#5533) 2025-01-03 17:23:45 +00:00
Lucas Oliveira
a6bebd5fcb
docs: remove Guides, add pages on other categories, add Types (#4881)
* Adds Chat Memory on Components

* Removes Guides

* Adds Types

* Fix links that referenced Guides

* combine-files

* redirects

* content

* fix(docs): update sidebar position and redirect path in configuration files

* feat(docs): update memory components documentation and sidebar links

* feat(docs): enhance configuration documentation with ContentBlock and DataFrame examples

* add-link-for-pydantic-baseclass

* update-links

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-01-03 16:58:29 +00:00
Mendon Kissling
d790761ff0
docs: fix onBrokenAnchor behavior and links (#5520)
* fix: component url errors

* remove-unnecessary-nav-controls

* fix: update link-ids so onBrokenAnchors doesnt throw warnings

* delete unused category files

* delete unused sidebar_position

* space

* docs: format URLs in documentation for consistency

* fix: urls returning 404s

* backtick
2025-01-03 16:30:59 +00:00
Cristhian Zanforlin Lousa
16ff8eb200
feat(model): replace MessageTextInput with MultilineInput for system_message (#5532)
 (model.py): introduce MultilineInput class to handle system messages in LCModelComponent for better organization and readability

📝 (Basic Prompting.json): Update node IDs and edge IDs for better readability and consistency in the JSON file.

📝 (Basic Prompting.json): Update node properties to display a chat message in the Playground instead of generating text using OpenAI LLMs
♻️ (Basic Prompting.json): Refactor field_order and outputs properties for the Chat Output node to include new fields and remove unnecessary ones

 (Basic Prompting.json): Update ChatOutput component to include new inputs and outputs for better customization and functionality. Add support for storing messages, setting sender type, and customizing message appearance.

 (Basic Prompting.json): Update field names and values for better clarity and consistency
♻️ (Basic Prompting.json): Refactor field names and values to improve readability and maintainability

 (Basic Prompting.json): Update the content of the file to include a new class 'OpenAIModelComponent' with inputs for configuring OpenAI model settings and methods for building the model and handling exceptions. Remove the 'data_template' field and update 'input_value' field to 'MessageInput'. Add new fields 'json_mode', 'max_tokens', 'model_kwargs', and 'model_name' with their respective configurations.

📝 (Basic Prompting.json): Update values and descriptions for fields in the Basic Prompting starter project to improve clarity and usability. Add a new field for temperature control with a default value of 0.1.
2025-01-03 14:23:52 +00:00
Gabriel Luiz Freitas Almeida
3e23800199
feat: Implement streaming support and EventManager integration in flow execution (#5460)
* refactor: add create_stream_tokens_event_manager for handling streaming events

* feat: integrate EventManager into run_graph_internal for enhanced event handling

- Added EventManager import and parameter to run_graph_internal function.
- Updated function call to include event_manager for improved event management during graph execution.

* feat: enhance Graph class with event_manager parameter

- Added event_manager parameter to multiple methods in the Graph class to facilitate better event management during graph execution.
- Updated process and run methods to include event_manager, ensuring it is passed through to relevant function calls.
- Improved documentation for methods to reflect the new event_manager parameter.

* feat: implement streaming support in flow execution with EventManager integration

- Added support for streaming responses in the simplified_run_flow endpoint, allowing real-time event handling during flow execution.
- Introduced consume_and_yield and run_flow_generator functions to manage event consumption and client communication.
- Integrated EventManager for enhanced event tracking, including success and error notifications.
- Updated endpoint documentation to reflect new streaming capabilities and parameters.
- Improved error handling and logging for better debugging and client disconnection management.

* refactor: remove request logging from simplified_run_flow endpoint

- Removed the logging of the request object in the simplified_run_flow function to streamline logging and reduce verbosity.
- This change enhances the clarity of logs by focusing on essential information during flow execution.
2025-01-03 14:21:14 +00:00
Sebastián Estévez
63d649b0f4
feat: add anthropic mcp endpoint (#5148)
* mcp WIP

* [autofix.ci] apply automated fixes

* logging and flow user check

* mcp stdio client component

* handle disconnect better

* initialization

* session fix and type fix

* [autofix.ci] apply automated fixes

* defensive against mcp server bugs

* [autofix.ci] apply automated fixes

* notifications and sse component

* enabled flags and resource support

* remove unneeded print

* extract json schema util

* [autofix.ci] apply automated fixes

* ruff

* fix tools [] bug and db asysnc session api change

* Tool instead of StructuredTool

* ruff fixes

* ruff

* validation optimization

* fix frontend test

* another playwright fix

* Update src/frontend/tests/extended/features/notifications.spec.ts

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

* mcp component descriptions

* mypy fixes

* fix setup_database_url test

---------

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-03 04:45:54 +00:00
Mendon Kissling
ee19feaf39
docs: add components-processing link to sidebar and update documentation link in component (#5526)
feat: add components-processing link to sidebar and update documentation URL for RecursiveCharacterTextSplitter
2025-01-02 22:04:37 +00:00
Rodrigo Nader
70eaacfd36
feat: improve gitloader component (#5351)
* feat: improve gitloader component

* [autofix.ci] apply automated fixes

* feat(git.py): refactor GitLoaderComponent to support asynchronous operations and improve temporary directory management

- Convert methods to async to enhance performance with file operations.
- Implement async context manager for handling temporary clone directories.
- Update binary file check and content filtering to be asynchronous.

* fix(git.py): enhance GitLoaderComponent with improved file filtering and binary check

- Refactor file filtering logic to utilize fnmatch for pattern matching.
- Introduce a new method to check for binary files based on null byte detection.
- Update content filtering to handle exceptions more gracefully.
- Modify temporary directory cleanup to use rmdir instead of remove for better directory management.
- Adjust load_documents method to utilize asyncio.to_thread for lazy loading of documents.

* refactor(git.py): enhance GitLoaderComponent with improved file filtering and binary check

- Refactor binary file check to be synchronous and handle exceptions more gracefully.
- Introduce new methods for checking file patterns and content patterns, allowing for more flexible filtering.
- Consolidate filtering logic into a single method for better maintainability.
- Update load_documents method to run lazy loading in a separate thread for improved performance.

* feat(tests): add unit tests for GitLoaderComponent file filtering and binary detection

- Introduced new test suite for GitLoaderComponent, including tests for binary file detection and file pattern matching.
- Implemented temporary file creation for testing various file types and permissions.
- Added tests for combined filtering functionality, ensuring robust handling of file and content patterns.

* refactor(git.py): improve pattern handling and content filtering in GitLoaderComponent

- Refactored pattern handling to use a more descriptive variable name `pattern_list` for clarity.
- Enhanced content filtering by ensuring proper encoding when reading file content.
- Updated regex validation to include a test string check for better error handling.
- Removed unnecessary comments to streamline the code and improve readability.

* fix: exception TypeError

TypeError: object async_generator can't be used in 'await' expression

---------

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: italojohnny <italojohnnydosanjos@gmail.com>
2025-01-02 16:39:16 +00:00
Gabriel Luiz Freitas Almeida
8ea4405010
refactor: run upgrade in dockerfiles to update dependencies (#5508)
chore: Update Dockerfiles to use COPY instead of ADD run apt-get upgrade

- Replaced ADD commands with COPY for better clarity and consistency across Dockerfiles.
- Added apt-get upgrade and clean commands to reduce image size and ensure packages are up to date.
- Updated user creation commands to include necessary cleanup steps.
- Ensured all Dockerfiles follow a similar structure for maintainability.
2025-01-02 15:49:41 +00:00
Gabriel Luiz Freitas Almeida
6c3cde8973
chore: Add manual trigger for Docker test workflow (#5509)
chore: Add workflow_dispatch trigger to docker_test.yml for manual workflow execution
2025-01-02 13:11:33 +00:00
anovazzi1
bf7d089847
Refactor: Remove unused API functions (#5488)
* refactor: Remove unused api functions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-01 03:37:13 +00:00
Ítalo Johnny
c55edcd97f
fix: resolve data keyword conflict in template formatting (#5483)
* fix: resolve data keyword conflict in template formatting

* refactor: simplify code

* test: add unit tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-31 13:13:31 +00:00
anovazzi1
52b2913abe
fix: Update dimensions of SvgLangwatch component (#5424)
refactor: update dimensions of SvgLangwatch component
2024-12-30 20:48:08 +00:00
Madhavan
6263c93684
docs: Improve developer docs with minor changes (#5417)
Improve developer docs with minor changes
2024-12-30 20:22:38 +00:00
Cristhian Zanforlin Lousa
eb120c116e
feat: enhance UX with clickable items and simplified structure (#5387)
🔧 (dropdownComponent/index.tsx): refactor dropdownComponent to improve code readability and remove unnecessary ShadTooltip component
2024-12-30 19:39:14 +00:00
Christophe Bornet
870aedf74e
fix: Fix parallel execution of alembic with SQlite (#5404)
Fix parallel execution of alembic with SQlite
2024-12-30 18:10:33 +00:00
Rogério Chaves
2ce33d41a8
fix(LangWatch): make current trace available for custom code to hook on to, allow to override input/output, fix icon (#5484)
* Call __enter__ to make current langwatch trace available globally so users can more easily add more context to it, like final input and output. This means also skipping setting the root_span input and output if already set

* Update LangWatch logo
2024-12-30 17:59:01 +00:00
Cristhian Zanforlin Lousa
86b3aefe89
fix: Prevent template value from overriding user input on tab switch (#5369)
* 🐛 (newChatView.tsx): fix issue where chat value was not being cleared when tab is hidden

* 🔧 (newChatView.tsx): refactor setting chat value to handle additional condition for better logic clarity
2024-12-30 13:40:01 +00:00
VICTOR CORREA GOMES
9d64d08cb5
feat(conditional-router): rename 'matches regex' to 'regex' (#5410)
* feat(conditional-router): rename 'matches regex' to 'regex'

- Simplify the operator name in the ConditionalRouter component
- Update dropdown options for better UX
- Maintain existing functionality while using more concise naming

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-30 12:28:33 +00:00
dhlidongming
9ee63109d4
fix: unify delete logic and fix cascade deletion for flows (#5466)
* Fix incomplete cascade deletion for flows.

* [autofix.ci] apply automated fixes

* Remove modification.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-29 13:52:53 +00:00
Andrey Tatarinov
5640f84f54
fix: StructuredOutputComponent tool name generation for multiple=True mode (#5476)
StructuredOutputComponent: fix tool name generation for multiple=True mode
2024-12-29 13:52:48 +00:00
Christophe Bornet
e91bcc2520
ref: Some ruff fixes from preview (#5420)
* Some ruff fixes from preview

* [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>
2024-12-28 21:25:35 +00:00
Christophe Bornet
3454ede5a5
ref: Use better task cancellation logic (#5397)
Use better task cancellation logic

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-28 04:54:55 +00:00
Christophe Bornet
70b4719def
fix: Bump blockbuster version to 1.5.8 (#5418)
Bump blockbuster version to 1.5.8

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-28 00:18:23 +00:00
tushar-composio
c4de1da4d4
fix: fetch composio apps list dynamically (#5427)
* fix: fetch composio apps list dynamically

* Ensure apps only get loaded once API key is entered

* Add comment

* typo fix

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-28 00:08:18 +00:00
Feng
a626209da6
fix: error message issue when "exception.body" is None (#5464)
fix errormessage issue when "exception.body" is None

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-27 23:48:20 +00:00
Gabriel Luiz Freitas Almeida
039f80cb50
refactor: Enhance frontend build process with detailed logging and error handling (#5473) 2024-12-27 12:23:54 -08:00
Gabriel Luiz Freitas Almeida
37126991f4
ci: Update Makefile to show output during frontend build (#5472) 2024-12-27 11:09:47 -08:00
Gabriel Luiz Freitas Almeida
8cbc6a9085
refactor: update simple API test JSON (#5469) 2024-12-27 09:21:37 -08:00
Gabriel Luiz Freitas Almeida
0118e98b5c
fix: adjust mouse actions in regression test for proper drag-and-drop (#5462) 2024-12-26 14:28:05 -08:00
Gabriel Luiz Freitas Almeida
5fd601bb77
tests: fix tests that use Chat Input (#5461) 2024-12-26 13:46:20 -08:00
Gabriel Luiz Freitas Almeida
d31be29245
fix: Update import path for IOModal to new naming convention (#5423) 2024-12-24 04:34:43 -08:00
Cristhian Zanforlin Lousa
4fec41fcce
perf: add useMemo to chatHistory to avoid unecessary renders on Playground (#5376)
* fix uncessary renders on chat

* 📝 (chat-view.tsx): optimize rendering performance by memoizing ChatMessage component and using memoized version for chat history items

* ♻️ (chat-view.tsx): refactor memoized ChatMessage component to include additional props for improved performance and accuracy
2024-12-24 01:16:36 +00:00
Lucas Oliveira
ca8f3cad62
feat: add generic handle that inherits colors for multiple types (#5414)
* Fixed HandleTooltipComponent to use the type instead of passed color

* Fixed handle colors to use the connected edge color

* Changed color of generic handle

* Fixed edge color when clicking for generic handles

* Updated sidebar filter to contain more than one type

* fixed gradient generalBugs
2024-12-23 22:18:11 +00:00
Lucas Oliveira
bd7f913d28
fix: add minimized attribute to components and make chatinput and chatoutput start minimized by default (#5374)
* Added Minimized field to backend to make component start as minimized

* Added minimized as true to chat components

* Added showNode default value as the opposite of minimized

* Changed starter projects to new components

* [autofix.ci] apply automated fixes

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

* Fixed Freeze and DecisionFlow tests

* Fixed other tests that involved chatoutput and chatinput

* Restored tests that didnt fail

* Fixed stop playground test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-23 22:09:22 +00:00
Cristhian Zanforlin Lousa
b4673d3656
refactor(sidebar): Optimize FlowSidebarComponent with improved search and performance (#5411)
*  (flowSidebarComponent/index.tsx): reorganize imports and remove unnecessary comments for better code readability and maintainability
♻️ (flowSidebarComponent/index.tsx): refactor filtering logic to improve performance and readability
🔧 (flowSidebarComponent/index.tsx): update variable names and state management for better clarity and consistency
💡 (flowSidebarComponent/index.tsx): add comments and organize code structure for easier understanding and future development

📝 (flowSidebarComponent/index.tsx): refactor useEffect hooks to improve code readability and maintainability
📝 (flowSidebarComponent/index.tsx): refactor drag handling function to use useCallback for better performance
📝 (flowSidebarComponent/index.tsx): refactor bundle and category checks to use useMemo for better performance

* ♻️ (flowSidebarComponent/index.tsx): Remove unnecessary comments and optimize code readability by removing redundant comments and improving code structure.

* package-lock
2024-12-23 20:16:33 +00:00
Cristhian Zanforlin Lousa
c227a9b58d
refactor: update GlobalVariableModal description text (#5405)
📝 (GlobalVariableModal.tsx): update description text to remove incorrect information about encryption for better clarity
2024-12-23 18:55:43 +00:00
Lucas Oliveira
1daf915169
fix: add data field to returned object on flowheader if flow is a component (#5373)
* Fixed FlowHeader model validator, adding data and removing it if flow is not a component

* [autofix.ci] apply automated fixes

* Fixed flowheader to use fieldvalidator instead of modelvalidator

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-23 18:54:40 +00:00
Christophe Bornet
9fc3601df8
fix: Fix parallel execution of alembic with PostgreSQL (#5408)
Fix parallel execution of alembic with PostgreSQL
2024-12-23 18:53:07 +00:00