Commit graph

13,181 commits

Author SHA1 Message Date
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
Gabriel Luiz Freitas Almeida
5da1130f84
chore: add --ignore=tests/integration flag from pytest command in pyproject.toml and remove unit (#2468)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-05 16:08:44 +00:00
Carlos Coelho
bc6b846454
fix: change DirectoryComponent to filter file paths by types (#2391)
* Refactor DirectoryComponent to filter file paths by types

* fix: sets types is_list to True

* chore: Remove Optional from load_directory method signature

* chore: Update return type annotation for load_directory method

* style(GroqModel.py): improve code readability by fixing indentation and adding a comment for type hint ignore in ChatGroq instantiation.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-05 12:17:14 -03:00
Gabriel Luiz Freitas Almeida
e536272759
fix(langflow): handle KeyboardInterrupt and terminate process in run function for graceful shutdown (#2551)
* fix(langflow): handle KeyboardInterrupt and terminate process in run function for graceful shutdown

* refactor(langflow): remove unnecessary try-except block and sys.exit calls in run_langflow function

* fix(langflow): handle exceptions properly and exit with appropriate status codes

* refactor: update multiprocess imports in langflow/__main__.py

Adds type ignore
2024-07-05 15:04:33 +00:00
codeflash-ai[bot]
4954b3fa66
perf: ️ Speed up convert_kwargs() by 9% in src/backend/base/langflow/interface/initialize/loading.py (#2529)
* refactor(base.py): refactor logic to find start_component_id based on multiple keywords for improved flexibility and readability

* feat(schema.py): add WebhookInput component type to INPUT_COMPONENTS list for handling webhook inputs in the graph schema

* refactor(base.py): refactor logic to determine start_component_id based on webhook or chat component presence in input vertices

* refactor: prioritize webhook component for determining start_component_id

* ️ Speed up convert_kwargs() by 9%
To optimize the given Python program, we can focus on a few key areas.

1. **Avoid Repeated Lookups:** Instead of repeatedly looking up keys and values in the dictionary, we can iterate over items directly.
2. **Efficient JSON Parsing:** Using `orjson` is already a good choice for performance. We will handle the exception based on `orjson` capabilities.
3. **In-place Modification:** We can modify the dictionary in place without creating additional lists.

Here is the optimized program.



### Changes Made.

1. **Direct Looping:** We iterate directly over `params.items()` to process keys and values together, which helps avoid multiple lookups.
2. **Exception Handling:** We catch `orjson.JSONDecodeError` directly, avoiding unnecessary import and potential mismatches.
3. **Deferred Removal:** We collect keys to remove in `items_to_remove` and then remove them outside the loop, which helps avoid modification issues during iteration.

This should result in more efficient iteration and handling while reducing overhead from unnecessary operations.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 07:51:50 -07:00
Igor Carvalho
6f827ca3dd
fix: pasting files not working (#2548)
* fix: pasting files not working

* [autofix.ci] apply automated fixes

* refactor: change new import

---------

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: anovazzi1 <otavio2204@gmail.com>
2024-07-05 13:57:48 +00:00
Gabriel Luiz Freitas Almeida
6488b0247e
ci: add delete-reports job to delete if all jobs succeed (#2542)
chore: Add conditional step to delete-reports job in TypeScript test workflow
2024-07-05 10:56:27 -03:00
anovazzi1
eed5a6390a
fix: version display (#2555)
* fix version

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 13:38:58 +00:00
Gabriel Luiz Freitas Almeida
3900c58983
fix(ordering): correctly remove vertex from list of runnable vertices (#2554) 2024-07-05 13:30:54 +00:00
anovazzi1
46f82a6af4
fix: update use-get-health.ts (#2553)
* update getHealth function to use options param

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 13:18:38 +00:00
ming
c444a6905c
feat: opentelemetry and prometheus (#2543)
* opentelemetry and prometheus

* set env override in create_app

* add prometheus_client to pyproject

* update top level poetry.lock
2024-07-05 12:50:53 +00:00
Lucas Oliveira
6b3f34da77
fix: refactor of api structure (#2544)
* Refactored mutation and query types and callables

* Refactored version and other queries to new way of calling function

* update type declaration to support options

* update getVersionQuery

* [autofix.ci] apply automated fixes

* update type declaration to remove on Fetch options

* remove onFetch from version

* update transactions query

* [autofix.ci] apply automated fixes

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-07-05 12:44:10 +00:00
Igor Carvalho
6443354720
refactor: change node to component on FE constants (#2545) 2024-07-05 09:34:24 -03:00
anovazzi1
6160f70011
feat: improve getHealth logic (#2537)
* create get health custom hook

* refactor getHealth to use useQuery get

* fix: getHealth in App.tsx

* [autofix.ci] apply automated fixes

* refactor: update API endpoint in useGetHealthQuery

* chore: use new get_helth body

* [autofix.ci] apply automated fixes

* update interfaces names

* [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-05 12:03:52 +00:00
Gabriel Luiz Freitas Almeida
71e3ed92d8
ci: add outputs and conditional step to TypeScript test workflow (#2541)
* feat: Add outputs to TypeScript test workflow

The recent code changes added outputs to the TypeScript test workflow in order to capture the status of the tests. This will allow for better visibility and tracking of test failures.

* chore: Add conditional step to merge-reports job in TypeScript test workflow
2024-07-04 20:59:46 +00:00
Cristhian Zanforlin Lousa
bfaac8b4ba
refactor: add new use-query endpoint of upload files (#2533)
* refactor: add new use-query endpoint of upload files

* extend type for payload callbackSuccess

* [autofix.ci] apply automated fixes

* bugfix: drag and drop image on chat not working

* Refactored query function to use Options

* Used dedicated function as queryFn

*  (API): export use-post-upload-file in files index
♻️ (FileInput): refactor file upload mutation to use onSuccess and onError
♻️ (chatInput): refactor file upload mutation to use onSuccess and onError
♻️ (chatView): refactor file upload mutation to use onSuccess and onError

* ♻️ (use-get-download-images.ts): simplify getDownloadImagesFn function
♻️ (use-get-transactions.ts): simplify getTransactionsFn function
 (use-handle-file-change.tsx): add hook to handle file input changes
 (use-upload.tsx): add hook to handle file paste events

* Added type on Request Processor

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-07-04 20:25:57 +00:00
Cristhian Zanforlin Lousa
4f586adf0a
fix: remove uneceessary logic to disable button on search components/flows (#2540)
♻️ (index.tsx): simplify disableInputSearch logic by removing redundant conditions
2024-07-04 17:10:26 -03:00
Cristhian Zanforlin Lousa
2b8d314e30
test: fix test after changes on LLMs components (#2538)
*  (tests): remove redundant test assertions in filterEdge-shard-0.spec.ts
 (tests): add new test assertions and remove redundant ones in filterEdge-shard-1.spec.ts

*  (filterSidebar.spec.ts): add test for visibility of helpersID Generator
♻️ (filterSidebar.spec.ts): remove redundant visibility test for textsplittersCharacterTextSplitter

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-04 18:54:01 +00:00
Jordan Frazier
a933139927
docs: small updates to astra vectorize docs (#2497)
small updates to vectorize docs

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-04 18:25:58 +00:00
Gabriel Luiz Freitas Almeida
05efa58f5e
feat: add auto_merge_enabled to pull_request_target types in conventional-labels.yml (#2539) 2024-07-04 15:24:37 -03:00
Gabriel Luiz Freitas Almeida
03329b232e
fix: make webhook api call honor webhook component as input (#2511)
* refactor(base.py): refactor logic to find start_component_id based on multiple keywords for improved flexibility and readability

* feat(schema.py): add WebhookInput component type to INPUT_COMPONENTS list for handling webhook inputs in the graph schema

* refactor(base.py): refactor logic to determine start_component_id based on webhook or chat component presence in input vertices

* refactor: prioritize webhook component for determining start_component_id

* feat(utils.py): add function find_start_component_id to find component ID based on priority list of input types

* refactor(graph/base.py): refactor logic to find start component id in Graph class for better readability and maintainability

* test(test_webhook.py): override pytest fixture to check for OpenAI API key in environment variables before running tests

* test(test_webhook.py): update webhook json

* feat(schema.py): update WebhookInput component type name

* refactor: log package run telemetry in simplified_run_flow

* test: add test for webhook flow on run endpoint

* refactor(graph/base.py): skip unbuilt vertices when getting vertex outputs in Graph class

* refactor: simplify data_input assignment in LCTextSplitterComponent

* refactor: remove unused build method in CharacterTextSplitterComponent

* refactor: update imports in CharacterTextSplitter.py
2024-07-04 11:11:55 -07:00
Nicolò Boschi
86aaab0cec
feat: migrate text splitters to Component syntax (#2530)
* feat: migrate text splitters to Component syntax

* [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-04 10:29:33 -07:00
Cristhian Zanforlin Lousa
cb8185237a
refactor: add types to constant on IO (#2536) 2024-07-04 17:00:52 +00:00
Igor Carvalho
911035cdd3
feat: refactor version api (#2534)
* feat: create useGetVersionQuery function

* [autofix.ci] apply automated fixes

* fix: extend useQuery type to accpet functions with no parameters

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-04 16:37:21 +00:00
Gabriel Luiz Freitas Almeida
f0725ce874
chore: remove unnecessary output in validate-pr job (#2535) 2024-07-04 13:37:15 -03:00
Gabriel Luiz Freitas Almeida
f2d949b64e
feat(PR): add conditions to label pr (#2532)
* chore: update conventional-labeler action to version 2.0.0

* chore: add 'bug' label to fix category in release.yml

* chore(conventional-labels.yml): add 'Validate PR' job to validate pull requests before labeling them
chore(conventional-labels.yml): add 'Label PR' job to label pull requests after validation is successful

* chore(conventional-labels.yml): update conditional statement in Label PR job to exclude Bot users from linting and only run if PR validation is successful

* chore(conventional-labels.yml): update type_labels mapping to align with conventional commit keywords for better labeling in GitHub actions.

* fix(conventional-labels.yml): run workflow only on editing the PR

* chore(conventional-labels.yml): do not require an issue reference
2024-07-04 08:11:37 -07:00
Ítalo Johnny
29e662848c
chore: simplify docker (#2526)
* chore: add docker command shortcuts to makefile

* chore: replaced entreypoint with cmd

* chore: remove enviroment variable
2024-07-04 11:14:52 -03:00
anovazzi1
1a035a923c
fix: Remove chroma.sqlite3 from git (#2531)
remove chroma.sqlite3 from git
2024-07-04 11:11:41 -03:00
Gabriel Luiz Freitas Almeida
238497d900
ci: add GitHub Actions workflow for labeling PRs with Conventional Commits (#2522)
* feat: Add GitHub Actions workflow for labeling PRs with Conventional Commits

* feat(release.yml): add release.yml file with predefined categories for changelog to improve consistency and clarity in release notes

* style(release.yml): change 'perf' label to 'performance' for better clarity and consistency across labels in changelog section
2024-07-04 10:38:47 -03:00
Gabriel Luiz Freitas Almeida
bf5e7b343a
fix(base.py): only add successors if is_start (#2513) 2024-07-04 14:25:16 +02:00
Gabriel Luiz Freitas Almeida
15aa68a342
fix: make end_all_traces be called at the correct moment (#2516)
* fix(tracing/service.py): remove wait_for_all_tracers call

* refactor: set reasonable timeout for TelemetryService client

* fix: handle HTTP and request errors in TelemetryService

Handle HTTPStatusError and RequestError exceptions separately in the send_telemetry_data method of TelemetryService to provide more specific error messages. Also, catch any unexpected exceptions and log them with an appropriate error message.

* fix: cancel worker task and close client in TelemetryService stop method

Cancel the worker task and close the client in the stop method of TelemetryService to ensure proper cleanup and prevent potential resource leaks. Also handle any exceptions that may occur during the cleanup process and log appropriate error messages.

* style(telemetry/service.py): fix indentation issue in await statement to comply with PEP8 guidelines

* feat(graph): add method to remove vertex from runnables in Graph class

* fix(chat.py): fix issue where vertex was not being removed from runnables list to prevent duplication of results

* fix(chat.py): defines when the end_all_traces call should happen
2024-07-04 14:24:45 +02:00
Gabriel Luiz Freitas Almeida
fd9664fd51
ci: update autofix workflows (#2521)
* chore: update py_autofix.yml workflow to run Ruff Check and Format

* ci(js_autofix.yml): remove unnecessary pull request types to trigger workflow only on changes in src/frontend directory
2024-07-04 14:23:58 +02:00
Gabriel Luiz Freitas Almeida
a9f955d916
fix: handle unknown artifact type in post_process_raw function (#2527)
Handle the case where the artifact type is unknown and the raw value is not None in the post_process_raw function. Set the raw value to "Built Successfully " in this case.
2024-07-04 14:18:37 +02:00
Cristhian Zanforlin Lousa
8980e75723
bugfix: fix api request custom component (#2470)
* bugfix: fix api request custom component

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-04 05:05:22 -07:00
Cristhian Zanforlin Lousa
fb21fdda5e
fix: spec files cant find .env variable on CI (#2514)
* bugfix: add env import to spec files correctly

* 🔧 (ci.yml): fix indentation for consistency and readability in CI workflow

* ci: add inputs to workflow

* bugfix: improve flaky test general bugs to run smoothier on CI

* ci: add more shards to improve tests on CI
2024-07-04 01:36:07 +00:00
596050
be21f2f95a
fix: fixes react key error in browser on flow page for extra sidebar disclosure components (#2295)
Fixes key error in browser on flow page for extra sidebar disclosure components

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-04 00:42:41 +00:00
Cristhian Zanforlin Lousa
9af47895f9
feat: POC of useQuery -> mutation and query (#2512) 2024-07-03 19:16:23 -03:00
Igor Carvalho
d03a7fd5a3
feat: show why group button is disabled (#2507)
* Refactor: Show why group button is disabled

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-03 22:55:42 +02:00
Lucas Oliveira
17b730b6cf
fix: update node logic (#2515)
* Fixed bug where updating the node does not remove edited status

* Fixed order of edited override

* Made all node-changing functions to alter type the right way

* Update StoreMessageComponent for enhanced message handling

- Changed base class from CustomComponent to Component
- Added multiple input fields: message, sender, sender_name, session_id
- Included output field for stored messages
- Improved logic to handle both string and Message types
- Enhanced error handling and validation for message storage

* Apply Ruff formatting

* Update StoreMessageComponent for enhanced message handling

* Apply Ruff formatting

* Feat: add more types

* Format code

* feat: Add CreateListComponent for creating a list of texts

This commit adds a new component called CreateListComponent, which is responsible for creating a list of texts. The component takes in one or more texts as input and outputs a list of Data objects. This component is useful for scenarios where a list of texts needs to be processed or manipulated.

The CreateListComponent class is added to the helpers module in the langflow.components package. It includes the necessary inputs and outputs, as well as a create_list method that generates the list of Data objects based on the input texts.

This commit also includes some minor changes to other files, such as renaming the UUIDGeneratorComponent to IDGeneratorComponent and updating import statements.

* [autofix.ci] apply automated fixes

* Changed native categories to use the keys of the style utils categories, which is updated

* change component name

* chore: add the name attribute to the CustomComponent

* chore: assign the value of name to the components

* chore: change the logic of the type value returned

* chore: extract code to new func

* chore: change component_name value

* [autofix.ci] apply automated fixes

* Formatted files

---------

Co-authored-by: Rodrigo <rodrigosilvanader@gmail.com>
Co-authored-by: rodrigosnader <rodrigosnader@users.noreply.github.com>
Co-authored-by: igorrCarvalho <igorsilvabhz6@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-07-03 17:55:01 -03:00
anovazzi1
8017122d29
chore: update langflow-embedded-chat script URL to v1.0.3 (#2482)
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-03 22:33:18 +02:00