Commit graph

13,220 commits

Author SHA1 Message Date
Jordan Frazier
7d3d621045
docs: make astra vectorize provider key advanced param (#2639) 2024-07-11 19:11:38 +02:00
596050
180e475cc3
Frontend Feature: Multiselect ui-component and merge refs hook (#2405)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-11 09:14:10 -07:00
Nicolò Boschi
feed388857
fix: qdrant with ingest not working (#2636) 2024-07-11 09:12:22 -07:00
Gabriel Luiz Freitas Almeida
2a8bd2347b
feat: update dependencies for Google Authentication Library and Google Calendar API (#2626)
This commit updates the dependencies for the Google Authentication Library and Google Calendar API. It includes the following changes:
- Upgraded google-auth to version 2.15.0
- Added google-auth-oauthlib version 1.2.1
- Added langchain-google-calendar-tools version 0.0.1

These updates ensure compatibility with the latest versions of the libraries and improve the functionality of the application.
2024-07-11 17:59:10 +02:00
Nicolò Boschi
ab0ab5f306
perf: improve /logs concurrent access (#2633)
* perf: improve /logs concurrent access

* perf: improve /logs concurrency access

* fix

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-11 15:06:34 +00:00
Igor Carvalho
3d0845c8bd
feat: update starter projects (#2630) 2024-07-11 16:05:08 +02:00
ming
81849d5f8b
feat: log retriever endpoint (#2601)
* log retriever endpoint

* disabled by default

* realtime log stream via http/2 SSE

* read and write lock

* unit test
2024-07-11 11:19:21 +02:00
ming
7bd105007e
feat: add opentelemetry utility functions and unit tests (#2570)
* add opentelemetry utility functions and unit tests

* review comments

* add label validation
2024-07-10 15:01:38 -04:00
anovazzi1
fb39c095da
fix: issue with freeze value on page refresh (#2623) 2024-07-10 18:51:14 +00:00
Ítalo Johnny
aa1958a4ad
feat: refactor graph vertex sorting (#2583)
* refactor: extract method from class to new func

* test: add new tests

* refactor: simplify funcs to improve readability

* refactor: extract new func from larger func

* refactor: remove recursion from func

* refactor: remove coupling with graph and vertex

* refactor: create adapter funcs to use new code

* refactor: add test for sorting up to vertex N with is_start=True

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-10 07:37:39 -07:00
Gabriel Luiz Freitas Almeida
3406575c67
feat: add Maritalk model component (#2595)
* feat: add Maritalk icon

* feat: add Maritalk model component

* fix: update icon size

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* style: format maritalk svg

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* feat: update 'stream' parameter to be advanced in MaritalkModelComponent

This commit updates the 'stream' parameter in the MaritalkModelComponent class to be an advanced option. By setting the 'advanced' attribute to True, the 'stream' parameter will only be visible to advanced users. This change improves the usability of the component by hiding this option from regular users who do not need it.
2024-07-10 09:13:19 -03:00
Nicolò Boschi
05044a3434
feat: migrate agents and toolkits to Component syntax (#2579)
* feat: migrate agents and toolkits to Component syntax

* fix mypy

* fix mypy

* [autofix.ci] apply automated fixes

* fix mypy

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 05:09:14 -07:00
Nicolò Boschi
9c41b0c895
fix: azure embeddings models with fixed dimensions fail (#2619)
* fix: azure embeddings models with fixed dimensions fail

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 04:53:23 -07:00
himan-k
7414a01235
fixing ThreadingInMemoryCache usage (#2604)
* ThreadingInMemoryCache usage is broken. This commit addresses those issues along with missing documentation about the caching options.

* make lint & make unit_tests fixes

* removing unnecessary changes from unclear test results in  last run

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 04:52:37 -07:00
Gabriel Luiz Freitas Almeida
d28fe8eedc
fix: Improve vertex filtering and update is_vertex_runnable logic (#2612)
* feat: improve is_vertex_runnable method in RunnableVerticesManager

This commit improves the `is_vertex_runnable` method in the `RunnableVerticesManager` class. It adds an additional parameter `activated_vertices` to the method signature and updates the logic to check if a vertex is runnable based on the presence of activated vertices. This enhancement improves the accuracy of determining whether a vertex is runnable or not.

* fix: add predecessors to vertices_to_run

* style: fix lint issues

* feat: optimize vertex filtering in useFlowStore

This commit optimizes the vertex filtering logic in the `useFlowStore` function in `flowStore.ts`. It introduces a more efficient way to filter out vertices that are already being built, resulting in improved performance and accuracy.

* refactor: add is_active method to Vertex class

This commit adds the `is_active` method to the `Vertex` class in the `base.py` file. The `is_active` method checks if the state of the vertex is set to `ACTIVE` and returns a boolean value accordingly. This enhancement improves the readability and maintainability of the codebase.

* refactor: improve is_vertex_runnable method in RunnableVerticesManager

* refactor: improve find_runnable_predecessors_for_successors method in Graph class

* refactor: move test_create_function
2024-07-10 07:40:16 -03:00
Jordan Frazier
46966d164d
tests: fix up the astra integ tests and add vectorize tests (#2616)
* fix up the astra integ tests and add vectorize tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 11:32:34 +02:00
Gabriel Luiz Freitas Almeida
34c1a4d469
fix: add timeout for unit tests workflows (#2613)
fix: add timeout for unit tests and test CLI in Python workflow
2024-07-09 19:08:39 -07:00
Cristhian Zanforlin Lousa
7174e6ef7d
fix: show loading component state while images arent fully loaded (#2609)
*  (ProfilePictureForm): add loading state to handle initial loading state

* ♻️ (use-get-profile-pictures.ts): refactor profile pictures query to process data on the server side
♻️ (ProfilePictureForm): simplify state management by removing redundant loading state

* ♻️ (use-get-profile-pictures.ts): rename ProfilePicturesResponse to ProfilePicturesQueryResponse for clarity
♻️ (use-preload-images.tsx): add loading check to useEffect to prevent unnecessary execution
♻️ (profilePictureChooserComponent): update profilePictures prop type to handle undefined and add loading to usePreloadImages
♻️ (ProfilePictureForm): remove unnecessary state and use response directly from useGetProfilePicturesQuery

* 🐛 (use-preload-images.tsx): add missing dependency 'loading' to useEffect dependency array to ensure images are preloaded correctly
2024-07-09 19:57:46 -03:00
Cristhian Zanforlin Lousa
0df06c01b0
fix: re-implement logic to correctly save or update flow in the appropriate folder on autologin = false (#2610)
♻️ (frontend): remove unused imports and variables in cardComponent
 (authContext): add setAllFlows and setSelectedFolder to AuthProvider
 (undrawCards): add folderIdUrl for better URL handling
 (collectionCard): add folder URL handling for navigation
 (use-delete-multiple): add setAllFlows and setSelectedFolder to handleDeleteMultiple
 (componentsComponent): add isLoadingFolders and setSelectedFolder
 (tabsComponent): add folder URL handling for tab navigation
 (flowsManagerStore): add folder URL handling in saveFlowDebounce

 (foldersStore.tsx): add setSelectedFolder method to manage selected folder state
♻️ (foldersStore.tsx): move setIsLoadingFolders call to improve loading state management
 (flowsManager/index.ts): add folderId parameter to saveFlow and saveFlowDebounce methods for better flow management
 (folders/index.ts): add setSelectedFolder method to FoldersStoreType for better folder state management
2024-07-09 15:29:52 -07:00
Gabriel Luiz Freitas Almeida
fd36938a03
feat: update custom component attributes on /update endpoint (#2607)
feat: Update custom component attributes with load from DB fields

This commit updates the `custom_component_update` endpoint in `endpoints.py` to include the logic for updating custom component attributes with load from DB fields. The `cc_instance` is checked for the presence of a `set_attributes` method, and if it exists, the template and parameters are extracted from the code request. The load from DB fields are identified and used to update the parameters. Finally, the `set_attributes` method is called with the updated parameters. This enhancement improves the flexibility and functionality of custom components.
2024-07-09 11:29:30 -07:00
Gabriel Luiz Freitas Almeida
06464eda46
feat: adds NVIDIA components (#2591)
* chore: Update langchain-nvidia-ai-endpoints dependency to version 0.1.2

* feat: Add NVIDIAEmbeddingsComponent for generating embeddings using NVIDIA models

* feat: Add NVIDIAModelComponent for generating text using NVIDIA LLMs

* feat: Add NvidiaRerankComponent for reranking documents using the NVIDIA API and a retriever

* fix: add type ignore

* chore: Update NVIDIAEmbeddingsComponent and NVIDIAModelComponent to handle type ignore

* chore(poetry.lock): update lock
2024-07-09 15:26:23 -03:00
João Pedro Miranda C. Hluchan
a6f128c4cf
Add CrewAI Component Documentation (#2519)
* feat: CrewAI components static files

* feat: CrewAI add .md guide files

* feat: CrewAI add CrewAI_components_bundle.json

* chore: Comment out CrewAI section in sidebars.js

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-09 17:01:11 +00:00
Nicolò Boschi
e7e53abfbe
fix: astra vectorize auth error (#2606) 2024-07-09 17:23:30 +02:00
Gabriel Luiz Freitas Almeida
063cf54495
fix: update test_create_function to use pathlib.Path (#2605)
feat(test_validate_code.py): update test_create_function to use pathlib.Path instead of math.sin to check if it breaks ci
2024-07-09 08:16:50 -07:00
Gabriel Luiz Freitas Almeida
c20630b77d
fix: add vertices in the first layer to the vertices being run (#2594) 2024-07-09 12:03:55 -03:00
Nicolò Boschi
21adbd5531
fix: stream option is not working with tracing enabled (#2602)
* fix: cannot create 'generator' instances

* fix: cannot create 'generator' instances

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-09 13:37:47 +00:00
ming
ce9b4b09e5
feat: exception and error middleware (#2590)
exception and error middleware
2024-07-09 06:13:18 -07:00
Gabriel Luiz Freitas Almeida
4c43b4cc82
fix(runnable_vertices_manager.py): add recursive function to find predecessors (#2593)
fix(runnable_vertices_manager.py): add recursive function to find runnable predecessors
2024-07-08 22:14:36 +00:00
anovazzi1
311b66361e
fix: make chat lock when building (#2592)
Fix:lock chat bug
2024-07-08 14:22:00 -07:00
Gabriel Luiz Freitas Almeida
0d99bd3971
feat: update dependencies to add crewai (#2588)
Update the dependencies in `pyproject.toml` to their latest versions. Specifically, update `chromadb` to version `0.4`, `docstring-parser` to version `0.16`, and `crewai` to version `0.36.0`. This ensures that the project is using the most up-to-date packages and improves compatibility and stability.
2024-07-08 14:14:32 -07:00
skipandsnow
da2cab5a91
fix: Qdrant shows Qdrant.from_documents() missing 1 required positional argument: ‘embedding’ (#2587)
fixes the error
2024-07-08 21:08:58 +00:00
anovazzi1
ca3367d8e5
fix: Refactor messages API and session view (#2577)
* feat: create boilerplate code for messages api

* centering functionality on one component

* refactor useGetMessages

* update to new type format

* refactor Session view and get messages logic

* update to session view to useGetMessageQuery

* remove old api call

* feat: create boilerplate code for messages api

* centering functionality on one component

* refactor useGetMessages

* update to new type format

* refactor Session view and get messages logic

* update to session view to useGetMessageQuery

* remove old api call

* [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 <72977554+Cristhianzl@users.noreply.github.com>
2024-07-08 14:05:31 -07:00
Gabriel Luiz Freitas Almeida
38b10b02df
feat: add vertices_being_run set to RunnableVerticesManager (#2589)
* refactor(base.py): remove unnecessary conditional statements for adding edges to predecessor and successor maps in Graph class

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class

* refactor(graph/base.py): remove unnecessary line that adds vertex_id to vertices_ids set
refactor(graph/base.py): fix indentation for predecessor_map and successor_map dictionaries to improve code readability

* feat: Add vertices_being_run set to RunnableVerticesManager

This commit adds a new set called `vertices_being_run` to the `RunnableVerticesManager` class. This set keeps track of vertices that are currently running. The purpose of this set is to prevent a vertex from being considered runnable if it is already being run.

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

* chore: Remove unnecessary vertex from next_runnable_vertices in RunnableVerticesManager

* feat: Update vertices_to_run logic in retrieve_vertices_order function

This commit updates the logic for retrieving the vertices to run in the `retrieve_vertices_order` function in `chat.py`. The previous implementation used the `list` function to convert the `vertices_to_run` set to a list and then concatenated it with the result of the `get_top_level_vertices` function. The updated logic uses the `union` method to combine the two sets directly. This change improves the efficiency and readability of the code.

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class
2024-07-08 13:48:20 -07:00
Gabriel Luiz Freitas Almeida
46b7911110
test(test_webhook): change component in webhook test to be async (#2578)
* feat: Add aiofiles package for asyncio file support

* fix: add async component in webhook test flow

* refactor: deactivate astra db test

* refactor: remove AstraDB test and related code

* feat: add component that makes an async api call

* chore: Update langsmith and sentry-sdk dependencies to latest versions
2024-07-08 09:38:22 -07:00
Gabriel Luiz Freitas Almeida
7e222187e4
fix: remove redundant superuser only if it has never logged in (#2582)
fix: Remove redundant superuser only if it has never logged in

The code changes in `utils.py` check if the superuser exists and if it has never logged in. If both conditions are true, the superuser is deleted from the database. This improves the efficiency and security of the application.
2024-07-08 16:37:03 +00:00
feiyang_deepnova
4d5a0df8d1
fix: the pythonfunction test error (#2572)
fix the test error
2024-07-08 15:48:33 +00:00
Lucas Oliveira
74433bf023
fix: outdated code conditions and global variable (#2581)
* Fixed Check Code Validity to set outdated as false when type does not exist

* feat: Refactor update_template_values function

Refactor the `update_template_values` function to improve code readability and maintainability. Rename the parameters `frontend_template` to `new_template` and `raw_template` to `previous_template` for clarity. Update the variable names within the function accordingly.

* feat(update_template_field): update load_from_db in case field value is not the default

* refactor: update template values in PromptComponent

Update the `update_template_values` function in the `PromptComponent` class to improve code readability and maintainability. Rename the parameters `frontend_template` to `new_template` and `raw_template` to `previous_template` for clarity. Update the variable names within the function accordingly.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-08 15:23:03 +00:00
Jordan Frazier
2736d5920b
docs: small updates to vectorize docs (#2580)
* small updates to vectorize docs

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-08 08:17:56 -07:00
Nicolò Boschi
8339fcf0d8
fix: astradb ingests twice (#2573) 2024-07-08 04:21:34 -07:00
ming
7dcc716811
fix: remove redundant and incorrect health check (#2571)
remove redundant health check and incorrect checks
2024-07-08 09:34:47 +02:00
ming
f6636551bb
feat: inmemory and async cache expire configurable (#2496)
inmemory and async cache expire configurable
2024-07-08 09:19:42 +02:00
Gabriel Luiz Freitas Almeida
7abf697b7b
fix: update run_manager on state changes (#2560)
* feat: update RunnableVerticesManager to include an update_run_state method

* feat: refactor build_run_map method in RunnableVerticesManager

This commit refactors the `build_run_map` method in the `RunnableVerticesManager` class. Instead of directly accessing the `graph` object, it now takes `predecessor_map` and `vertices_to_run` as parameters. This improves code readability and maintainability.

* fix(state): set vertices_to_run and predecessor_map correctly when updating a state

* fix: set inactive vertices to active when updating graph

* fix: add conditions to avoid duplicated vertices in maps

This commit fixes a bug in the Graph class where the predecessor and successor maps were not being updated correctly. The bug caused incorrect mapping of edges in the graph. This fix ensures that the maps are updated properly when adding edges to the graph.

* refactor: fix vertex build response in chat.py

This commit fixes the `build_vertex` function in `chat.py` to correctly handle the `VertexBuildResponse` object. The `inactivated_vertices`, `next_vertices_ids`, and `top_level_vertices` attributes are now converted to lists to remove any duplicate values. This ensures that the response object contains unique values for these attributes. The fix improves the accuracy and reliability of the vertex build process.

* style(graph/base.py): update type annotations for predecessor_map and successor_map variables to improve code readability and maintain consistency

* fix: uncomment code for stopping build in MenuBar component
2024-07-06 22:54:25 -04:00
Rodrigo Nader
64880850ce
Update README.md 2024-07-06 16:36:21 -03:00
Alexandre E. Souza
6257a32523
fix(QDrant): Resolve bug in document search functionality (#2518)
* Update Qdrant.py

fixed embeddings and distance_func for search_documents issue #2517

* [autofix.ci] apply automated fixes

* fixed documents link

* update params Qdrant

* Update Qdrant.py

* Update Qdrant.py

* Update Qdrant.py

* [autofix.ci] apply automated fixes

* Update args

* [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>
2024-07-06 10:06:00 -07:00
Gabriel Luiz Freitas Almeida
9e6fe193c9
chore: update version to 1.0.7 in pyproject.toml (#2562)
* chore: update version to 0.0.83 in pyproject.toml

* chore: update version to 1.0.7 in pyproject.toml

---------

Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-06 10:05:21 -07:00
dependabot[bot]
ac469531ea
chore(deps): bump certifi from 2023.11.17 to 2024.7.4 (#2566)
Bumps [certifi](https://github.com/certifi/python-certifi) from 2023.11.17 to 2024.7.4.
- [Commits](https://github.com/certifi/python-certifi/compare/2023.11.17...2024.07.04)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 10:04:19 -07:00
Gabriel Luiz Freitas Almeida
1d8362c9c1
fix: add user to database if not present in health_check (#2564)
* fix: add user to database if not already present in health_check

The code changes in `health_check_router.py` add functionality to check if a user with a specific ID exists in the database. If the user does not exist, the code adds the user to the database with the necessary details. This ensures that the user is present in the database for further processing in the health check.

* style(health_check_router): format
2024-07-05 20:33:26 +00:00
Cristhian Zanforlin Lousa
e63479556c
fix: add click event on button to retry check connection to backend (#2558)
♻️ (App.tsx): remove console.log statement from setRetry function
🐛 (fetchErrorComponent): add onClick handler to Retry button to ensure retry logic is executed
2024-07-05 16:57:20 +00:00
Nicolò Boschi
eb3420523e
feat: migrate chains and memories to Component syntax (#2528)
* feat: migrate chains and memories to Component syntax

* use base class

* add classes

* [autofix.ci] apply automated fixes

* fix tests

* fix tests

*  (filterSidebar.spec.ts): increase waitForTimeout from 1000ms to 2000ms to ensure elements are fully loaded before interaction

---------

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>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-05 16:30:23 +00:00
Gabriel Luiz Freitas Almeida
5d9b29e2ae
fix: make sure old secret keys are handled as before (#2557)
* refactor: add padding function for string in auth utils

* fix(auth utils): run add_padding if the secret_key is valid
2024-07-05 09:11:03 -07:00