Commit graph

5,907 commits

Author SHA1 Message Date
Eric Hare
77a82d7cc5
fix: set embedding dict to empty if vectorize (#5258)
* fix: set embedding dict to empty if vectorize

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-13 20:25:47 +00:00
Eric Hare
b28c6dcc55
fix: support additional autodetect astradb params (#5254)
* fix: support additional autodetect astradb params

* [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-13 16:23:43 -03:00
Sergey Ryabov
ee31f152ad
feat: Add AgentQL integration (#4998)
AgentQL is a query language and a set of supporting developer tools designed to identify web elements and their data using natural language and return them in the shape you define.
Added AgentQL data extraction component. See: https://docs.agentql.com/rest-api/api-reference

This pull request introduces a new component, AgentQL, to both the backend and frontend of the project. The changes include the implementation of the AgentQL component, its integration into the frontend, and the addition of a new icon for AgentQL.

* feat: Add AgentQL integration

* upd: Update the logo

* upd: Update field type

* upd: Address feedback + better error handling

* upd: Change DictInput type & mark 'advanced' fields

* upd: Update wording

* upd: Update wording

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2024-12-13 13:38:09 -05:00
Gabriel Luiz Freitas Almeida
c40be15e9b
refactor: reduce logging of SQLite pragmas and enhance model provider type safety (#5235)
* feat: add ModelProvidersDict TypedDict and update MODEL_PROVIDERS_DICT type annotation

- Introduced ModelProvidersDict as a TypedDict to define the structure for model provider configurations.
- Updated MODEL_PROVIDERS_DICT to use the new TypedDict for improved type safety and clarity.
- Enhanced code readability and maintainability by specifying input types for model providers.

* fix: prevent duplicate logging of SQLite pragmas in DatabaseService

- Added a flag to track whether SQLite pragmas have been logged to avoid redundant log entries.
- Improved logging efficiency by ensuring that the debug message for setting pragmas is only logged once per session.
2024-12-13 14:20:55 +00:00
Christophe Bornet
384ac5e80e
ref: Add and use update_component_build_config utility (#5226)
* Add and use update_component_build_config utility

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-12 23:58:19 +00:00
Raphael Valdetaro
67892d4292
feat: add gemini-2.0-flash-exp and gemini-exp-1206 models (#5213) 2024-12-12 21:21:46 +00:00
Gabriel Luiz Freitas Almeida
222f15d8a1
fix: Ensure safe assignment to tool_blocks_map in agent_message handling (#5239)
fix: ensure tool_blocks_map assignment is safe by checking content availability in agent_message
2024-12-12 20:45:34 +00:00
Gabriel Luiz Freitas Almeida
c6b1eaba60
feat: add support for Python 3.13 (#5238)
* chore: update Python version requirement and remove deprecated dependencies in pyproject.toml files

* Updated Python version requirement to allow up to 3.14 in both main and base pyproject.toml files.
* Removed deprecated dependencies: cohere and pyautogen from the main dependencies list.

* chore: update Python version requirements and add support for Python 3.13 in uv.lock

* Updated the required Python version to allow up to 3.14.
* Adjusted resolution markers for Python versions to include 3.13.
* Added markers for the 'typing-extensions' dependency to restrict it for Python versions below 3.13.
* Included additional wheel files for various packages to support Python 3.13 compatibility.

* Update Python version requirements in README files to support Python 3.13

* Update Python version in GitHub Actions workflow to 3.13

* Update Python version in GitHub Actions workflows to include 3.13

* Update installation documentation to support Python 3.13 and clarify troubleshooting steps

* revert changes to docs until we release

* chore: add ag2 dependency and update uv.lock for Python 3.13 compatibility

* Added ag2 version 0.3.2 and 0.5.2 to pyproject.toml and uv.lock with appropriate resolution markers for Python versions.
* Included flaml version 2.3.2 in uv.lock to ensure compatibility with the new ag2 dependency.
* Updated dependency specifications to support Python 3.13 and above.
2024-12-12 12:24:43 -08:00
Eric Hare
a17335e802
fix: Do a better job of mapping Langchain to LiteLLM (#5233) 2024-12-12 18:56:39 +00:00
anovazzi1
0531084e35
fix: Refactor JSON serialization in build_flow and log_vertex_build (#5189)
* refactor(langflow): Update JSON serialization in build_flow and log_vertex_build

* Refactor JSON serialization in build_flow and log_vertex_build functions

* Refactor JSON serialization in build_flow and log_vertex_build functions
2024-12-12 18:51:24 +00:00
Gabriel Luiz Freitas Almeida
2c0991f9cf
fix: make user_id variable valid and fix type signature in messages endpoints (#5236)
* fix: enhance user_id validation in CustomComponent to ensure correct UUID handling

* Added type checks for user_id to ensure it is either a string or a UUID before conversion.
* Improved error handling by raising TypeError for invalid user_id types.

* fix: update flow_id and session_id types to UUID in monitor endpoint

* fix: convert flow_id to UUID type before adding messages

* fix: convert flow_id string to UUID when storing message

* fix: update session_id type to string in get_messages endpoint for improved type consistency
2024-12-12 18:46:08 +00:00
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