Commit graph

1,377 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
b9231aad8f 🔥 refactor(buildTrigger): remove unused imports and ProgressBarComponent
🐛 fix(buildTrigger): handle error response from server when starting a build
The ProgressBarComponent import was removed as it was not being used. The error handling was improved to handle the case where the server returns an error response when starting a build. The error message is now displayed to the user and the build state is reset.
2023-06-21 14:53:55 -03:00
Gabriel Luiz Freitas Almeida
38c2eaa897 🔥 refactor(chat.py): remove unused import statement
🐛 fix(chat.py): fix StreamData class import statement
 feat(chat.py): add progress tracking and node building events to stream_build function
The unused import statement has been removed to improve code readability. The StreamData class import statement has been fixed to avoid errors. Progress tracking and node building events have been added to the stream_build function to provide more information to the user about the build process.
2023-06-21 14:53:54 -03:00
Gabriel Luiz Freitas Almeida
fae1ca349f 🔧 chore(schemas.py): add StreamData model and __str__ method to improve readability of stream data
The StreamData model is added to represent the data that is streamed from the server. The __str__ method is added to improve the readability of the stream data by returning a formatted string that includes the event and data attributes.
2023-06-21 14:53:53 -03:00
Cristhian Zanforlin Lousa
22e24226a3 Refactor buildTrigger component to use progress state instead of myValue
The buildTrigger component was updated to use progress state instead of myValue to better represent the progress of the building process. This change allowed us to make improvements in the way progress is tracked, which will improve the user experience.
2023-06-21 14:50:38 -03:00
Cristhian Zanforlin Lousa
3a9315ed77 Merge branch 'feat/progressbar' of https://github.com/logspace-ai/langflow into feat/progressbar 2023-06-21 14:05:26 -03:00
Cristhian Zanforlin Lousa
0caab2e9ea Refactor buildTrigger event handling to handle end-of-stream event properly
This commit refactors buildTrigger event handling to ensure that end-of-stream events are handled by closing the connection without logging them.
2023-06-21 14:05:22 -03:00
Gabriel Luiz Freitas Almeida
0fb33825d9 🐛 fix(chat.py): change data to error in yield statement when flow_id is invalid
🐛 fix(chat.py): catch exception when building graph and yield error message
When the flow_id is invalid, the yield statement should return an error message instead of data. Additionally, when building the graph, an exception could occur, so we added a try-except block to catch any exceptions and yield an error message instead of data.
2023-06-21 14:04:45 -03:00
Cristhian Zanforlin Lousa
7a46794f1d Update radial progress & fix build trigger log handling
- The radial progress now displays the percentage value correctly.
- In the build trigger, we now properly handle the end of a stream event and fixed an issue with the RadialProgressComponent when isBuilding is true.
2023-06-21 14:04:35 -03:00
Cristhian Zanforlin Lousa
f2abb531d4 Add RadialProgress value state, remove progressContext
This commit adds a value state to the RadialProgress component, replacing the progressContext previously used. It also removes the progressContext, as it is no longer needed.
2023-06-21 13:50:27 -03:00
Cristhian Zanforlin Lousa
da28c2e670 Merge branch 'dev' into feat/progressbar 2023-06-20 21:04:28 -03:00
Cristhian Zanforlin Lousa
c06fdb1f13 Adding daisyUI radialProgress to project 2023-06-20 20:47:05 -03:00
Gabriel Luiz Freitas Almeida
2029b08d2e Merge remote-tracking branch 'origin/main' into dev 2023-06-20 16:18:37 -03:00
Gabriel Luiz Freitas Almeida
5f5bf06ab2 🐛 fix(flows.py): fix conditional statement in update_flow function
The conditional statement in the update_flow function was incorrect. The if statement was checking for the opposite of what was intended. The fix changes the if statement to check for the correct condition.
2023-06-20 16:11:33 -03:00
anovazzi1
46a30cf92e zoom out 10x bigger 2023-06-20 15:45:48 -03:00
Cristhian Zanforlin Lousa
625f22c024 Adding progress bar on build 2023-06-19 22:45:55 -03:00
Lucas Oliveira
c969bcca78 Fixed spearator 2023-06-19 19:33:07 -03:00
Gabriel Luiz Freitas Almeida
f511ddc20f Merge remote-tracking branch 'origin/main' into dev 2023-06-19 17:17:07 -03:00
Lucas Oliveira
b616e0dd42 fixed twitter link 2023-06-19 16:16:58 -03:00
Lucas Oliveira
9be559397b removed api key 2023-06-19 16:14:25 -03:00
Gabriel Luiz Freitas Almeida
825f2798c3 🐛 fix(chat.py): fix node to vertex variable name in stream_build function
 feat(chat.py): add progress logging to stream_build function
The variable node was renamed to vertex to improve semantics and consistency with the naming conventions. Progress logging was added to the stream_build function to provide feedback to the user on the progress of the build process.

🐛 fix(index.tsx): fix typo in setSuccessData function call
 feat(index.tsx): add success logging to handleBuild function
A typo in the setSuccessData function call was fixed. Success logging was added to the handleBuild function to provide feedback to the user on the success of the build process.
2023-06-19 16:03:25 -03:00
Lucas Oliveira
0dcd93ef92 added discord and twitter icons, added github stars 2023-06-19 15:45:26 -03:00
Gabriel Luiz Freitas Almeida
f180fa6f26 🐛 fix(process.py): change input parameter type hint to include Path type
The input parameter now accepts a Path object in addition to a string or dictionary. This improves the flexibility of the function and allows for easier file handling.
2023-06-19 14:25:10 -03:00
Gabriel Luiz Freitas Almeida
8a5525f465 🚀 feat(constants.tsx): add tweaks parameter to getPythonCode function to allow for customization of flow behavior
The `getPythonCode` function now accepts a `tweaks` parameter which is used to customize the behavior of the flow. The `buildTweaks` function is called to generate the `tweaks` object which is then passed to the `load_flow_from_json` function. This allows for more flexibility in the usage of the flow.
2023-06-19 14:24:48 -03:00
Gabriel Luiz Freitas Almeida
11185affdd 🐛 fix(process.py): refactor fix_memory_inputs function to improve readability and reduce nesting
The fix_memory_inputs function was refactored to reduce nesting and improve readability. The function now checks if the langchain_object has a memory attribute and if it is not None before proceeding. The try-except block was also refactored to reduce nesting.
2023-06-19 12:02:15 -03:00
Gabriel Luiz Freitas Almeida
83c28dcabe 🔨 refactor(process.py): refactor process_tweaks function to improve readability and maintainability
 feat(process.py): add input validation to process_tweaks function
The process_tweaks function has been refactored to improve readability and maintainability. The apply_tweaks function has been added to apply the tweaks to the node. The validate_input function has been added to validate the input parameters. The process_tweaks function now raises a ValueError if the input is not in the expected format.
2023-06-19 11:59:34 -03:00
Gabriel Luiz Freitas Almeida
6886828ddd 🔀 refactor(process.py): change load_flow_from_json function signature to accept either a JSON file path or a JSON object
🔀 refactor(base.py): import Chain from langchain.chains.base instead of importing it from langflow.graph.vertex.types
🔀 refactor(process.py): remove print statement from process_tweaks function
🔀 refactor(process.py): change load_flow_from_json function signature to accept optional tweaks parameter
🔀 refactor(process.py): change return type of build method in Graph class from List[Vertex] to Chain
🧪 test(loading.py): add test case for loading a flow from a JSON file and applying tweaks
🧪 test(loading.py): remove unused import statement
The import statement for Chain in base.py is now more explicit and imports it from langchain.chains.base instead of importing it from langflow.graph.vertex.types. The load_flow_from_json function in process.py now accepts either a JSON file path or a JSON object. The print statement in process_tweaks function has been removed. The load_flow_from_json function in process.py now accepts an optional tweaks parameter. The return type of the build method in the Graph class has been changed from List[Vertex] to Chain. A new test case has been added to loading.py to test loading a flow from a JSON file and applying tweaks. An unused import statement has been removed from loading.py.
2023-06-19 11:36:43 -03:00
Gabriel Luiz Freitas Almeida
5ea20aa2f0 🔨 refactor(constants.tsx): remove unnecessary indentation in getPythonCode function
The indentation of the commented line in the getPythonCode function was unnecessary and has been removed to improve code readability.
2023-06-19 10:55:18 -03:00
Gabriel Luiz Freitas Almeida
e01993b7f1 🐛 fix(__main__.py): add support for running Langflow on Windows
 feat(__main__.py): add support for running Langflow on MacOS and Linux using gunicorn
The changes add support for running Langflow on Windows by using uvicorn instead of gunicorn. This is because Windows doesn't support gunicorn. The changes also add support for running Langflow on MacOS and Linux using gunicorn. This is because MacOS requires an env variable to be set to use gunicorn.
2023-06-19 09:55:29 -03:00
dependabot[bot]
7111bee8db
build(deps-dev): bump vite from 4.3.5 to 4.3.9 in /src/frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.5 to 4.3.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.3.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-18 12:05:35 +00:00
Gabriel Luiz Freitas Almeida
b93d5020b3 🐛 fix(process.py): caching objects does not depend on is_first_message anymore 2023-06-17 13:34:35 -03:00
Gabriel Luiz Freitas Almeida
7d7986c5bd 🔥 chore(frontend): remove prepare-commit-msg git hook
The prepare-commit-msg git hook was removed from the frontend directory. This hook was not being used and was not necessary for the project's development workflow.
2023-06-16 19:57:33 -03:00
Gabriel Luiz Freitas Almeida
3a324ed45a Merge remote-tracking branch 'origin/main' into dev 2023-06-16 19:28:47 -03:00
Gabriel Luiz Freitas Almeida
fee54b817b 🐛 fix(process.py): fix conditional statement to check if "nodes" is in graph_data
The conditional statement was checking if "nodes" is in "graph_data['data']" instead of checking if "nodes" is in "graph_data". This fix ensures that the correct data is processed and avoids potential errors.
2023-06-16 19:06:46 -03:00
Gabriel Luiz Freitas Almeida
9ff68eef82 🔥 chore(main.py): remove unnecessary newline at the beginning of the file
The only change in this commit is the removal of an unnecessary newline at the beginning of the file. This improves the code's readability and consistency.
2023-06-16 19:01:41 -03:00
Gabriel Luiz Freitas Almeida
c7cbb40c36 format: run make format 2023-06-16 18:54:18 -03:00
Gabriel Luiz Freitas Almeida
b06e7a058a 🐛 fix(chat.py): add type hint to flow_data_store variable
🔥 chore(main.py): remove unused imports and variables
The `flow_data_store` variable in `chat.py` was missing a type hint, which was added to improve code readability and maintainability. In `main.py`, unused imports and variables were removed to improve code cleanliness.
2023-06-16 18:52:55 -03:00
Gabriel Luiz Freitas Almeida
28a902ec15 🚀 chore(MainPage): use constant for header text in user projects section
The changes in headerComponent remove unused imports and update the header text to use a constant instead of a hardcoded string. The constant is added in constants.tsx. The MainPage component is updated to use the constant for the header text in the user projects section. This improves code readability and maintainability.
🎨 style(headerComponent): remove unused imports and update header text to use constant
 feat(constants.tsx): add constant for header text in user projects section
2023-06-16 18:39:06 -03:00
Gabriel Luiz Freitas Almeida
bf621c78b4 🐛 fix(__main__.py): fix issue where app was not serving the index.html file when a 404 error occurred
 feat(main.py): remove static_path argument from create_app function
The fix to the issue where the app was not serving the index.html file when a 404 error occurred was done by adding an exception handler to the app that returns the index.html file when a 404 error occurs. The create_app function was modified to remove the static_path argument as it was not being used in the function.
2023-06-16 18:36:06 -03:00
anovazzi1
e1e5fb14c9 refactor(typesContext.tsx): reverse the order of keys in the types object to avoid overlap with tool world
The keys in the types object were reversed to avoid overlap with the tool world. This was done by modifying the reduce function in the TypesProvider component.
2023-06-16 18:20:06 -03:00
anovazzi1
20b19967da Merge branch 'db' of personal:logspace-ai/langflow into db 2023-06-16 17:52:43 -03:00
anovazzi1
ad6756c06c refactor(chatModal): replace react-icons with lucide-react icons for better performance and smaller bundle size 2023-06-16 17:52:21 -03:00
Gabriel Luiz Freitas Almeida
319a57eb19 🐛 fix(__main__.py): check if port is in use and get a free port if it is
 feat(__main__.py): add support for health check endpoint and use it to check server status
The `serve` function now checks if the specified port is in use and gets a free port if it is. This ensures that the server can run on a free port and avoids conflicts with other running applications. The `serve` function also now uses a health check endpoint to check the status of the server. The `setup_static_files` function now takes a `Path` object instead of a string for the static files directory. The `create_app` function now takes a `Path` object instead of a string for the static files directory.
2023-06-16 17:39:52 -03:00
Gabriel Luiz Freitas Almeida
0686626303 Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-16 17:25:20 -03:00
Rodrigo Nader
c9c226f464 Refactor the search placeholder and update the collections description
Update the search placeholder to be more general, from 'Search Nodes' to 'Search', in the extra sidebar component, and update the collection description from 'Download or upload your complete project collection' to 'Download or upload your collection' in the main page.
2023-06-16 17:23:29 -03:00
Gabriel Luiz Freitas Almeida
4d209ca21f 🐛 fix(constants.tsx): correct typo in API URL path
The API URL path was incorrectly spelled as "/ap1/v1/predict" instead of "/api/v1/predict". This commit fixes the typo to ensure that the correct API endpoint is used.
2023-06-16 17:23:01 -03:00
Rodrigo Nader
39707f9f80 Refactor error message for build trigger component
Changed the error message in the build trigger component to clarify which components need to be checked before retrying. Updated the list to include instructions on how to inspect the component status.
2023-06-16 17:19:49 -03:00
anovazzi1
cad24f1f88 fix(chatComponent): add isBuilt dependency to useEffect hook to avoid stale closure and improve performance 2023-06-16 17:16:36 -03:00
Gabriel Luiz Freitas Almeida
b476d0dd74 🐛 fix(endpoints.py): add try-except block when processing tweaks to catch and log exceptions
🐛 fix(process.py): fix KeyError when processing tweaks on graph_data with missing "data" key
The try-except block added in endpoints.py catches any exceptions that occur when processing tweaks and logs them to the logger. This helps with debugging and identifying issues with the processing of tweaks. In process.py, a KeyError was fixed by checking if the "data" key exists in the graph_data dictionary before accessing the "nodes" key.
2023-06-16 16:35:49 -03:00
anovazzi1
eed33f490c feat(App.tsx, FlowPage/index.tsx): add version number to the footer of the app to show the current version of LangFlow
refactor(App.tsx): remove redundant code that initializes the version state variable and fetches the version number from the API in FlowPage component instead
2023-06-16 16:27:13 -03:00
anovazzi1
036118011b comment projects on dropdown component 2023-06-16 16:23:35 -03:00