Commit graph

5,896 commits

Author SHA1 Message Date
Eric Hare
fc4d93a33d
fix: have defaults for the table schema (#5099) 2024-12-12 18:33:15 +00:00
Raphael Valdetaro
943bef1167
feat(component): implement directory component enhancements (#5012)
* feat: directory component enhancements

* [autofix.ci] apply automated fixes

* feat: update directory component implementation

* [autofix.ci] apply automated fixes

* feat(directory): add MultiselectInput for file types selection

* [autofix.ci] apply automated fixes

* Fix mypy issue

* Update directory.py

* fix: correct type annotation in DirectoryComponent to ensure list[Data] return type

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2024-12-12 10:23:07 -08:00
Christophe Bornet
2e19403660
ref: Make list_flows async (#5222)
* Make list_flows async

* Keep sync list_flows method for backward compatibility
2024-12-12 16:02:43 +00:00
Cristhian Zanforlin Lousa
2e7a5cdd67
fix: improve UUID handling in custom component variables (#5230)
* 🐛 (custom_component.py): fix user_id assignment to convert it to UUID type for consistency and correctness

* [autofix.ci] apply automated fixes

* 🐛 (custom_component.py): fix potential bug by checking if self.user_id is a string before converting it to UUID

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-12 15:13:38 +00:00
Gabriel Luiz Freitas Almeida
3de42f4575
feat: Update SQLModel dependency and improve UUID handling (#4891)
* Update sqlmodel dependency to version 0.0.20 in pyproject.toml

* Handle UUID conversion for message IDs in memory update logic

* Refactor Alembic migrations to use `sa.inspect` and update GUID to Uuid type

* refactor: Change flow_id parameter type from str to uuid.UUID in graph building functions

* refactor: Ensure UUID handling for flow_id and user_id across various services and models

* refactor: improve UUID handling and graph caching for compatibility with sqlmodel 0.0.20

* fix: update message assertion in component events test

* chore: update sqlmodel dependency to version 0.0.22 in uv.lock and pyproject.toml

* fix: enhance flow_id validation to ensure valid UUID format in MessageBase model

* fix: add error handling for cache directory cleanup

* refactor: improve flow_id type handling in message storage

* refactor: enhance flow_id handling in message functions to support UUID type

* refactor: integrate Properties into message creation in component event tests

* update test durations

* fix: correct flow_id parameter in database query

* refactor: update session_id and flow_id parameters to support UUID type across message handling functions and models

* fix: handle message data update in SQLModel update method

* refactor: improve flow_id assignment in message update method to enhance UUID handling
2024-12-12 04:58:27 -08:00
Christophe Bornet
4cc336fa45
ref: Use async list_variables (#5224)
Use async list_variables
2024-12-12 12:28:32 +00:00
Cristhian Zanforlin Lousa
262e3bd3cc
fix: use SecretStr get_secret_value for LMStudio API key handling (#5200)
* 🐛 (lmstudiomodel.py): fix issue with accessing secret value in api_key variable to prevent potential errors

* ♻️ (lmstudiomodel.py): refactor api_key assignment to simplify code and improve readability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-12 12:08:04 +00:00
Jordan Frazier
ba31d436c4
ci: script and workflow to update starter projects (#5195) 2024-12-12 02:48:55 +00:00
Vinícios Batista da Silva
3f9dab912c
feat: Restructure Youtube Transcripts component (#5118)
* feat: Restructure Youtube Transcripts component

- Changed the return type of the `build_youtube_transcripts` method from `Data` to `Message`.
- Updated the output name from "Data" to "Transcription" to reflect the new return type.
- Modified the return statements in `build_youtube_transcripts` to return `Message` objects instead of `Data`.

Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

* test(youtube-transcripts): enhance test stability by updating component ID and improving interaction checks

- Modified the component id in the test script to match the changes in the Youtube Transcripts component

Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

* fix: Fixed lint on line 180-181
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2024-12-11 20:27:19 +00:00
Cristhian Zanforlin Lousa
32ab4452f9
fix: Update Search API component to latest version from Travel Planning Agents template (#5192)
updating travel plannig agent - search api component
2024-12-11 18:08:18 +00:00
Christophe Bornet
abd3321677
ref: Make load_flow_from_json async (#5057)
* Make load_flow_from_json async

* Add back sync load_flow_from_json for backward compatibility
2024-12-11 17:53:33 +00:00
Christophe Bornet
4f5d7d93ad
fix: Add async aupdate_build_config to CustomComponent (#5181)
* Add async aupdate_build_config to CustomComponent

* Add test of backward compatibility
2024-12-11 16:25:15 +00:00
Eric Hare
a302a946f2
fix: Move crewai to root deps for now (#5204) 2024-12-11 08:15:03 -08:00
Christophe Bornet
624fa71709
feat: Activate sqlite blocking detection again (#5203)
Activate sqlite blocking detection again
2024-12-11 15:48:17 +00:00
Christophe Bornet
5ee995e89d
ref: Fix some ruff preview rules (#5156)
Fix some ruff preview rules
2024-12-11 13:37:29 +00:00
Jordan Frazier
ebfce9d8ea
feat: add optional env var to skip starter project updates (#5193)
* Add optional env var to skip starter project updates

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-11 12:24:39 +00:00
Raphael Valdetaro
152ed8bb54
refactor(openai): Remove deprecated parameters from OpenAI component (#5171)
* refactor(openai): remove deprecated output_schema and redundant output_parser parameters

* refactor(openai): remove output_schema and output_parser parameters

Following @ogabrielluiz's review feedback to properly handle removed inputs:

1. Remove output_schema parameter:
   - Remove from inputs list
   - Remove output_schema_dict conversion in build_model
   - Remove output_schema_dict usage in json_mode logic
   - Remove output_schema_dict usage in structured_output

2. Remove output_parser parameter:
   - Remove from inputs list (no code references to clean up as it wasn't being used)

This ensures we don't have any lingering references to removed parameters.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-10 14:45:32 +00:00
Christophe Bornet
fe6ec1690b
ref: Make create_or_update_starter_projects async (#5165)
Make create_or_update_starter_projects async
2024-12-10 07:51:35 +00:00
Christophe Bornet
63bdcb9d03
ref: Make initialize_database async (#5163)
Make initialize_database async
2024-12-10 07:44:34 +01:00
Christophe Bornet
e545d12c40
fix: Use anyio for file operations in a few places (#5167)
Use anyio for file operations in a few places
2024-12-10 01:55:42 +00:00
anovazzi1
6f5b984a22
fix: add load_from_db to all agents (#5170) 2024-12-09 23:50:08 +00:00
Edwin Jose
d4efcaa9ba
feat: add tool mode to AstraDB search input and enable AstraDB as a vector search Tool (#5075)
adding tool mode to Search input of AstraDB
2024-12-09 18:26:14 -05:00
Christophe Bornet
b692ef7848
fix: Execute event manager callbacks in asyncio thread (#5150)
Execute event manager callbacks in asyncio thread
2024-12-09 16:23:02 +00:00
Christophe Bornet
d58530c358
feat: Activate blockbuster Lock.aquire detection (#5157)
Activate blockbuster Lock.aquire detection

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-09 04:59:50 -08:00
Christophe Bornet
9fb59855a3
fix: Fix to_frontend_node modifying input components (#5116)
Fix to_frontend_node modifying input components
2024-12-09 11:09:17 +00:00
Christophe Bornet
abf38e96e2
feat: Add sqlite to blocking call detection (#4376) 2024-12-09 11:48:48 +01:00
Christophe Bornet
c0b25fa651
ref: Remove some useless asyncio.to_thread (#5149)
Remove some useless asyncio.to_thread
2024-12-08 20:13:08 +01:00
Christophe Bornet
0b39554795
ref: Apply ruff rule RUF052 (#5089)
Apply ruff rule RUF052
2024-12-08 11:51:02 +00:00
Christophe Bornet
60b1927cc5
ref: Apply ruff rule TC006 (#5088)
Apply ruff rule TC006
2024-12-08 11:35:00 +00:00
Christophe Bornet
2f0c67e851
ref: Bump ruff version to 0.8 (#5087) 2024-12-08 11:16:06 +00:00
Christophe Bornet
b98614ca5b
ref: Apply ruff rules FURB110 and RUF046 (#5093)
Apply rules FURB110 and RUF046
2024-12-08 11:05:07 +00:00
Christophe Bornet
9270f1a0f8
ref: Remove sync get_session and DbSession (#5146)
Remove sync get_session and DbSession
2024-12-08 10:27:19 +00:00
Christophe Bornet
624a2dde5d
ref: Use AsyncSession in some tests (#5151) 2024-12-08 01:09:43 +00:00
VICTOR CORREA GOMES
24ccb35a6b
feat(components): Add Webhook Icon to Component Definition (#5010)
* style: Add icon property to WebhookComponent class

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2024-12-06 11:38:23 -08:00
Rodrigo Nader
dee1439c78
feat: add tool mode to components that store and retrieve message history (#5110)
* add tool mode to components that store and retrieve message history

* [autofix.ci] apply automated fixes

* improve syntax

---------

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-12-06 18:16:04 +00:00
Rodrigo Nader
121b7c6e39
feat: Add tool mode to the prompt component (#5113)
* Add tool mode to the prompt component

* [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-12-06 18:03:49 +00:00
Christophe Bornet
79b03ba133
fix: Use AsyncSession in memory (#4665) 2024-12-06 16:25:59 +00:00
Cristhian Zanforlin Lousa
b2691eebce
feat: enhance slider component with labels and improved input handling (#5065)
* 📝 (openai.py): Update temperature slider range from 0-1 to 0-2 with step 0.01 for more precise control
📝 (sliderComponent/index.tsx): Update step value for slider component from 0.1 to 0.01 for smoother and more accurate adjustments
📝 (sliderComponent/index.tsx): Update MAX_LABEL from "Wild" to "Creative" for better semantic representation
📝 (sliderComponent/index.tsx): Add cursor-grabbing style when slider thumb is being grabbed to improve user experience

* 📝 (sliderComponent/index.tsx): improve styling and structure of the SliderComponent by refactoring the display value element to use a div container with appropriate classes and styles.

* 📝 (App.css): Add styles to hide spin buttons in input[type=number] elements for better UX
🔧 (sliderComponent/index.tsx): Add input element to allow users to directly edit the slider value for improved user experience

*  (slider-labels.tsx): Add SliderLabels component to display min and max labels with icons in SliderComponent for better user experience
📝 (index.tsx): Remove sliderInput prop and refactor SliderComponent to improve code readability and maintainability
🔧 (applies.css): Add styling for input-slider-text class to improve consistency in SliderComponent styling

* 📝 (applies.css): update hover:ring value to use variable hover:ring-slider-input-border for consistency and maintainability
📝 (index.css): add variable --slider-input-border to define the color value for slider input border
🔧 (tailwind.config.mjs): add slider-input-border custom property to map to the defined color value in the CSS variables

*  (build-color-by-name.ts): add function to dynamically build color based on input values to customize UI
 (get-min-max-value.ts): add function to get minimum or maximum value based on input constraints
🔧 (index.tsx): update import path for getMinOrMaxValue function
🔧 (index.tsx): add buildColorByName function to dynamically set thumb color based on percentage
🔧 (index.tsx): add logic to dynamically set background color gradient based on thumb color and percentage
🔧 (index.tsx): add logic to dynamically set thumb background color based on percentage and color calculation
2024-12-06 13:02:59 +00:00
Edwin Jose
fe4acf419b
fix: allow passing curly braces in system instructions to the Agent component (#5092)
update agent system instructions
2024-12-05 21:36:23 +00:00
Lucas Oliveira
dd6375978b
fix: changed parameter name of agent component (#4992)
* Changed Add tool Current Date to only Current Date

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-05 20:03:08 +00:00
Cristhian Zanforlin Lousa
369126a125
refactor: use Inspector for column checks in locked state migration (#5097)
🐛 (add_persistent_locked_state.py): fix migration script to correctly check for existing 'locked' column before adding or dropping it
2024-12-05 19:11:17 +00:00
Mike Fortman
ab4a587039
feat: Persist locked state for flows (#4459)
* persist locked state for flows

* [autofix.ci] apply automated fixes

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

* 📝 (popover.tsx): Remove duplicate declaration of PopoverAnchor in popover.tsx
 (lock-flow.spec.ts): Add test for locking and unlocking a flow in the application to ensure proper functionality and saving of the flow.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-12-05 17:03:24 +00:00
Ali Saleh
7c01b5a040
feat: Enhance Observability with ArizePhoenixTracer Integration (#5058)
* Added ArizePhoenixTracer

* [autofix.ci] apply automated fixes

* Fixed Ruff Style Check Errors

* add Arize icon

* Fixed Mypy Errors

* Refactor ArizeIcon component to use arrow function syntax

Co-authored-by: Jeff Carpenter <jeffrey.carpenter@datastax.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-12-05 16:09:02 +00:00
Christophe Bornet
c1bd7c89c3
fix: Fix test_get_and_cache_all_types_dict (#5054) 2024-12-05 14:15:21 +01:00
Cristhian Zanforlin Lousa
6c5c6461f2
fix: add hover state on folder button when moving flow to it (#4999)
*  (index.tsx): Refactor SideBarFoldersButtonsComponent to improve code readability and maintainability. Add new functionalities such as drag and drop, folder hovering effects, and folder actions like upload, download, add, update, and delete. Update folder state management and handle loading states for various folder operations.

*  (add-folder-button.tsx): Add a new component for adding folders to the sidebar
 (folder-select-item.tsx): Add a new component for displaying folder select items in the sidebar
 (header-buttons.tsx): Add a new component for displaying header buttons in the sidebar
 (input-edit-folder-name.tsx): Add a new component for editing folder names in the sidebar
 (select-options.tsx): Add a new component for displaying select options in the sidebar
 (upload-folder-button.tsx): Add a new component for uploading folders to the sidebar
 (handle-select-change.ts): Add a new helper function for handling select changes in the sidebar
🔧 (index.tsx): Refactor sidebar folder buttons component to use new components and helpers for better organization and functionality

*  (use-on-file-drop.tsx): add support for fetching and using flows specific to the current folder in the file drop functionality
📝 (use-get-folder.ts): update the get folder query to set and use flows specific to the current folder
📝 (foldersStore.tsx): add state management for storing and setting flows specific to the current folder in the store
📝 (index.ts): add FlowType import for flows specific to the current folder in the store types

*  (flows.py): Add description field to the returned flow object in read_flows function for better data representation
♻️ (use-on-file-drop.tsx): Refactor code to use new centralized store for flows instead of accessing flowsFromCurrentFolder directly
🔧 (use-get-folder.ts): Remove setFlowsFromCurrentFolder function and directly update flows in the store within getFolderFn
🔧 (foldersStore.tsx): Remove flowsFromCurrentFolder state and setFlowsFromCurrentFolder function from the store as they are no longer needed
2024-12-04 21:06:02 +00:00
Edwin Jose
2c56177ef1
feat: Table Input for tools metadata (tool name and description) in component as tools (#4961)
*  (endpoints.py): Add support for tool_mode field in custom component update
🔧 (schemas.py): Add tool_mode field to UpdateCustomComponentRequest schema
♻️ (component.py): Refactor run_and_validate_update_outputs method to handle tool_mode field
🔧 (index.tsx): Add tool_mode property to NodeInputField component
🔧 (index.tsx): Refactor hasToolMode logic to use checkHasToolMode utility function
🔧 (mutate-template.ts): Add callback parameter to mutateTemplate function
🔧 (use-handle-new-value.tsx): Add tool_mode property to useHandleOnNewValue hook
🔧 (popover/index.tsx): Add console.log for placeholder, value, and id
🔧 (inputGlobalComponent/index.tsx): Add tool_mode property to InputGlobalComponent
🔧 (refreshParameterComponent/index.tsx): Add tool_mode property to RefreshParameterComponent
🔧 (use-post-template-value.ts): Add tool_mode parameter to usePostTemplateValue function
🔧 (nodeToolbarComponent/index.tsx): Add support for tool_mode functionality in NodeToolbarComponent
🔧 (reactflowUtils.ts): Add checkHasToolMode utility function to check for tool_mode field in template

* fix: Set default value for tool_mode in UpdateCustomComponentRequest schema

* adding table input in tool mode

adding table input

* Update component.py

update real-time refresh

* added dynamic tool description input

added dynamic tool description input

* [autofix.ci] apply automated fixes

* Update component.py

simplifying the tool mode logic

* Update component_tool.py

updated logic to be more readable

* Update component.py

* adding tool table schema as constant

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
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-04 20:22:14 +00:00
Ítalo Johnny
505368ece7
fix: validate 'streaming' vertex connections in graph (#5067) 2024-12-04 19:53:54 +00:00
Eric Hare
10475693e5
fix: support Astra Enhanced flag in new component (#5056)
* fix: support Astra Enhanced flag in new component

* Fiz env variable used for dynamic display
2024-12-04 07:55:57 -08:00
Christophe Bornet
24f9cac9b5
fix: Use AsyncSession in crud log and find_flow (#4691)
Use AsyncSession in crud log and find_flow
2024-12-04 15:24:23 +00:00
Christophe Bornet
ba9dea5547
fix: Use AsyncSession in some API endpoints (#4650)
* Use AsyncSession in some API endpoints

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-04 15:14:01 +00:00