8aac63b830🐛 fix(chat.py): add try-except block to handle exceptions in init_build function The try-except block was added to handle exceptions that may occur in the init_build function. If an exception occurs, it is logged and an HTTPException with a status code of 500 is returned. This ensures that the server does not crash and provides a more informative error message to the client.
Gabriel Luiz Freitas Almeida
2023-06-13 20:32:05 -03:00
0b4925bddfMerge branch 'validation_fix' of personal:logspace-ai/langflow into validation_fix
anovazzi1
2023-06-13 20:24:38 -03:00
044b01e6ad🎨 style(chat.py): add status code 201 to init_build endpoint The init_build endpoint now returns a status code of 201 to indicate that a new resource has been created. This improves the consistency of the API and makes it easier for clients to understand the response.
Gabriel Luiz Freitas Almeida
2023-06-13 20:23:44 -03:00
2def9b2e5eMerge branch 'db' into mainPage
Lucas Oliveira
2023-06-13 20:07:44 -03:00
bc254a8aeeAdded importing flow to the same flow
Lucas Oliveira
2023-06-13 20:07:08 -03:00
78faae8372Merge branch 'validation_fix' of personal:logspace-ai/langflow into validation_fix
anovazzi1
2023-06-13 20:01:02 -03:00
97645884abAdded project settings modal
Lucas Oliveira
2023-06-13 20:00:46 -03:00
0259bf4acc🎨 style(endpoints.py): rename get_load function to predict_flow for better semantics The function name was changed to predict_flow to better reflect the functionality of the endpoint.
Gabriel Luiz Freitas Almeida
2023-06-13 19:53:00 -03:00
f1f36024e9Added description to pages
Lucas Oliveira
2023-06-13 19:45:50 -03:00
8689c39c06Merge remote-tracking branch 'origin/mainPage' into db
Gabriel Luiz Freitas Almeida
2023-06-13 19:43:56 -03:00
af8afea421🚀 feat(chatComponent): update API endpoint for build stream 🚀 feat(vite.config.ts): add new API route for build stream The API endpoint for the build stream has been updated to /api/v1/build/stream/${flowId} to improve consistency with the naming conventions. The vite.config.ts file has been updated to include the new API route for the build stream.
Gabriel Luiz Freitas Almeida
2023-06-13 19:42:30 -03:00
ddd0b05947Added default description and redirected to new flow as soon as its created
Lucas Oliveira
2023-06-13 19:16:27 -03:00
b6757d3ac1Removed unused functions
Lucas Oliveira
2023-06-13 19:10:26 -03:00
1a92ceca7eAdded community page, fixed styling of buttons, added promise at AddFlow
Lucas Oliveira
2023-06-13 19:09:24 -03:00
1a6406e394Merge branch 'validation_fix' of personal:logspace-ai/langflow into validation_fix
anovazzi1
2023-06-13 18:45:57 -03:00
86751e0dafadded try catch block on streamNodeData
anovazzi1
2023-06-13 18:45:42 -03:00
ebf5568db0🐛 fix(App.tsx): change fetch URL to match backend API endpoint The fetch URL was changed to match the backend API endpoint. The previous URL was incorrect and caused the fetch request to fail.
Gabriel Luiz Freitas Almeida
2023-06-13 18:08:01 -03:00
52baae64e6🔨 refactor(chatComponent): remove unused imports and variables, and extract postBuildInit function to API controller ✨ feat(API): add postBuildInit function to handle POST requests to /api/v1/build/init The chatComponent file had unused imports and variables that were removed to improve code readability. The postBuildInit function was extracted to the API controller to improve code organization and maintainability. The function handles POST requests to /api/v1/build/init.
Gabriel Luiz Freitas Almeida
2023-06-13 18:05:11 -03:00
Update base.py
Gabriel Luiz Freitas Almeida
2023-06-13 17:31:53 -03:00
41f6aecda4🔀 refactor(chat.py): import InitResponse and BuiltResponse from schemas module 🚀 feat(chat.py): add response models to /build/init and /build/{flow_id}/status endpoints The InitResponse and BuiltResponse models are now imported from the schemas module to improve code organization. The /build/init and /build/{flow_id}/status endpoints now have response models to provide a clear understanding of the expected response.
Gabriel Luiz Freitas Almeida
2023-06-13 17:21:45 -03:00
cfbcedcf5f🔖 chore(pyproject.toml): bump up version to 0.0.89 The version number in the pyproject.toml file has been updated from 0.0.87 to 0.0.89. This is a chore commit as it does not introduce any new features or fix any bugs, but rather updates the version number to reflect the changes made in the package.
Gabriel Luiz Freitas Almeida
2023-06-13 15:04:41 -03:00
188fd4ad0a🐛 fix(custom.py): remove unnecessary type ignore comments The type ignore comments are unnecessary as the code is already type annotated. Removing them improves code readability and maintainability.
Gabriel Luiz Freitas Almeida
2023-06-13 15:04:23 -03:00
14757ca402Rename agent - initialize_agent to AgentInitializer
gustavoschaedler
2023-06-13 18:51:33 +01:00
09d4c89136🐛 fix(loading.py): ensure metadata values are not None for Chroma class The docstring for the CombineDocsChain class has been updated to reflect the correct function name. In the loading.py file, the instantiate_vectorstore function has been updated to ensure that metadata values are not None for the Chroma class. This is because Chroma requires all metadata values to not be None, and this fix ensures that the application will not encounter errors when using Chroma. 🐛 fix(custom.py): update docstring to reflect the correct function name
Gabriel Luiz Freitas Almeida
2023-06-13 14:07:27 -03:00
2d3428307e🔨 refactor(constants.tsx): remove flowId from API_URL and add it to the headers as an Authorization token The flowId is now passed as an Authorization token in the headers of the API request. This improves security as the flowId is not exposed in the URL. The API_URL now only contains the base URL without the flowId.
Gabriel Luiz Freitas Almeida
2023-06-13 12:49:41 -03:00
90a1dd9795🔧 chore(process.py): refactor process_tweaks function to improve readability and maintainability The process_tweaks function has been refactored to improve readability and maintainability. The function now takes in two parameters, graph_data and tweaks, and returns the modified graph_data. The tweaks parameter is a dictionary of dictionaries, where the key is the node id and the value is a dictionary of the tweaks. The function processes the graph data to add the tweaks by iterating over the nodes and checking if the node id is in the tweaks dictionary. If it is, the function applies the tweaks to the node by updating the template data with the new values. The function also prints a message to the console to indicate that a tweak has been applied.
Gabriel Luiz Freitas Almeida
2023-06-13 12:49:22 -03:00
faf44eca0e🔧 refactor(schemas.py): add optional tweaks field to PredictRequest schema The PredictRequest schema now includes an optional tweaks field, which is a dictionary of dictionaries. This field allows for additional customization of the prediction request, such as specifying tool names or descriptions. The tweaks field is optional, and if not provided, the default value is an empty dictionary. The schema_extra attribute has also been updated to include an example of the new tweaks field.
Gabriel Luiz Freitas Almeida
2023-06-13 12:49:11 -03:00
7cc14e83b8🚀 feat(endpoints.py): add authentication to predict endpoint using HTTPBearer 🐛 fix(endpoints.py): change predict endpoint to use Flow object instead of flow_id 🐛 fix(endpoints.py): add support for processing tweaks in predict endpoint The predict endpoint now requires authentication using HTTPBearer. The flow_id is now extracted from the bearer token instead of being passed as a parameter. This improves security as the flow_id is not exposed in the URL. The predict endpoint now uses the Flow object instead of the flow_id to retrieve the graph data. This improves code readability and reduces the number of database queries. The predict endpoint now supports processing tweaks, which allows for more flexibility in the processing of messages.
Gabriel Luiz Freitas Almeida
2023-06-13 12:48:52 -03:00
8b6af6b768Undo and Redo icons changed
Lucas Oliveira
2023-06-13 11:41:41 -03:00
1452e9c7a2added useUndoRedo to context and added Undo and Redo buttons to header
Lucas Oliveira
2023-06-13 11:41:03 -03:00
ab0209d399Import shad dialog, CSS in general
Cristhian Zanforlin Lousa
2023-06-13 11:22:43 -03:00
1af07ec453Fixed flow id after uploading to DB
Lucas Oliveira
2023-06-13 11:00:09 -03:00
809e4c5306Merge branch 'mainPage' of github.com:logspace-ai/langflow into mainPage
Lucas Oliveira
2023-06-13 10:51:47 -03:00
d76d0b2d51Upload and Download Flows done, fixed deleting flow bug
Lucas Oliveira
2023-06-13 10:51:10 -03:00
eb26216d51🗑️ chore(langflow.db): remove langflow.db file The langflow.db file was deleted. This commit removes the file from the repository.
Gabriel Luiz Freitas Almeida
2023-06-13 08:05:31 -03:00
74192c205cgit ignore updated to ignore db
Lucas Oliveira
2023-06-12 22:10:57 -03:00
513174fb3ascroll and general position bug fixed
anovazzi1
2023-06-12 22:08:16 -03:00
35fea98301Fixed bug with home page overflow
Lucas Oliveira
2023-06-12 21:47:56 -03:00
74954dd4b1Fixed bug where flow disappears
Lucas Oliveira
2023-06-12 21:47:02 -03:00
91b243779cAdded buttons on sidebar and fixed header visual bug
Lucas Oliveira
2023-06-12 21:46:21 -03:00
2d640c8e5aBack button added, chevron with dropdown added to flow name
Lucas Oliveira
2023-06-12 21:17:44 -03:00
e491064662Removed menubar edit and file, added all into the project name
Lucas Oliveira
2023-06-12 20:44:35 -03:00
d14be904ad🐛 fix(chat.py): raise HTTPException instead of returning JSONResponse on stream_build error The function stream_build was returning a JSONResponse with an error message when an exception was raised. This is not the correct way to handle errors in FastAPI. Instead, we should raise an HTTPException with the appropriate status code and error message.
Gabriel Luiz Freitas Almeida
2023-06-12 20:43:55 -03:00
7b44b18726🐛 fix(loading.tsx): fix broken link to the source of the Loading component The React import is not used in the file, so it has been removed to improve code readability. The link to the source of the Loading component was broken, so it has been fixed to ensure that the component can be used properly. 🔥 chore(loading.tsx): remove unused React import
Gabriel Luiz Freitas Almeida
2023-06-12 18:31:10 -03:00
d300c0b428💄 style(chat.py): reformat code to improve readability The unused imports and exception handling for WebSocketDisconnect and WebSocketException were removed from the chat.py file. The code was reformatted to improve readability. 🔥 refactor(chat.py): remove unused imports and exception handling
Gabriel Luiz Freitas Almeida
2023-06-12 18:30:47 -03:00
a41cc95abbadded security check to avoid errors on building empty flows
anovazzi1
2023-06-12 20:26:56 -03:00
62b0b28b7fstart websocket from chat only after build
anovazzi1
2023-06-12 20:23:52 -03:00
83e592d4d7fixed routing, working perfectly
Lucas Oliveira
2023-06-12 20:15:07 -03:00
f9cece1ecelock click on loading state of button
anovazzi1
2023-06-12 20:10:40 -03:00
b45966051afixed header to new logic
Lucas Oliveira
2023-06-12 19:23:34 -03:00
9408442191Fixed logic to simplify transition to routes
Lucas Oliveira
2023-06-12 19:21:48 -03:00
78ce80098dadjust dark mode and dropdown
Cristhian Zanforlin Lousa
2023-06-12 18:55:00 -03:00
1fdf03c925validating nodes before sending it to the backend
anovazzi1
2023-06-12 18:30:53 -03:00
72dea88f14moved validateNodes function to utils
anovazzi1
2023-06-12 18:20:52 -03:00
ceb9b1d155Added flow id and routes logic
Lucas Oliveira
2023-06-12 18:19:05 -03:00
312e0c4834🐛 fix(GenericNode): set validationStatus to null when relevantData is null This change fixes a bug where the validationStatus state was not being set to null when relevantData was null. This caused the validationStatus to retain its previous value, which could lead to incorrect validation results being displayed.
Gabriel Luiz Freitas Almeida
2023-06-12 17:05:05 -03:00
fe0c6f7f38🐛 fix(chat.py): rename websocket_endpoint to chat for better semantics ✨ feat(chat.py): add build_status endpoint to check if flow_id is in flow_data_store The function name websocket_endpoint was renamed to chat to improve semantics. The new build_status endpoint was added to check if a flow_id is in the flow_data_store. This endpoint returns a JSON response with a boolean value indicating whether the flow_id is built or not. If the flow_id is not in the flow_data_store, a JSON response with a value of False is returned. If an exception occurs, a 500 HTTPException is raised with the exception message as the detail.
Gabriel Luiz Freitas Almeida
2023-06-12 17:04:52 -03:00
de7b2c9f31🔥 chore(chatComponent): remove unused imports and API call The import for the postBuild function was removed as it was not being used in the BuildTrigger component. This improves the code's readability and maintainability.
Gabriel Luiz Freitas Almeida
2023-06-12 17:04:19 -03:00
d381228b83🚀 feat(API): add BuildStatusTypeAPI to API types and implement getBuildStatus function The BuildStatusTypeAPI was added to the API types to support the new getBuildStatus function. The getBuildStatus function retrieves the build status of a flow by making a GET request to the server. This function is useful for updating the UI with the current status of a flow.
Gabriel Luiz Freitas Almeida
2023-06-12 17:03:54 -03:00
68e17384c8🔧 chore(chatModal): extract getWebSocketUrl function to improve readability and maintainability The getWebSocketUrl function was extracted to improve the readability and maintainability of the code. It takes the chatId and isDevelopment flag as parameters and returns the WebSocket URL based on the current environment. The function uses the window.location object to determine the protocol and host, and the chatEndpoint to construct the URL.
Gabriel Luiz Freitas Almeida
2023-06-12 17:03:36 -03:00
bc499b285d🚀 feat(api): add BuildStatusTypeAPI to represent the status of a build The BuildStatusTypeAPI is added to represent the status of a build. It contains a boolean value indicating whether the build was successful or not.
Gabriel Luiz Freitas Almeida
2023-06-12 17:03:22 -03:00
Refactor frontend API use (#477)
anovazzi1
2023-06-12 16:37:08 -03:00
0dc8ca8682bugfixes: darkmode and not saving file/text
Cristhian Zanforlin Lousa
2023-06-12 13:57:56 -03:00
a7c9b04611🚨 test(conftest.py): add basic_graph_data fixture to load basic example data 🚨 test(test_websocket.py): add tests for build init, stream, and websocket endpoint The basic_graph_data fixture is added to load the basic example data. The test_init_build, test_stream_build, and test_websocket_endpoint tests are added to test the build init, stream, and websocket endpoint. The test_websocket_endpoint_after_build test is added to test the websocket endpoint after the build.
Gabriel Luiz Freitas Almeida
2023-06-12 13:06:39 -03:00
585aeeab6e🔥 refactor(base.py): remove unnecessary build method call in Graph class The build method call in the for loop of the build_vertices method is unnecessary as the vertices are already sorted and built in the topological_sort method. The yield from statement is used to return the sorted vertices.
Gabriel Luiz Freitas Almeida
2023-06-12 13:05:27 -03:00
64397d2830🔨 refactor(buildTrigger): change allNodesValid to validationResults array and add finished variable to improve readability 🚀 feat(buildTrigger): add waiting for stream to finish and return validation results for each node The allNodesValid variable has been changed to a validationResults array to store the validation results for each node. A finished variable has been added to improve readability and to wait for the stream to finish. The function now returns an array of validation results for each node.
Gabriel Luiz Freitas Almeida
2023-06-12 13:05:02 -03:00
baeadf018d✨ feat(chat.py): improve SSE response by adding node id and valid flag The changes in this commit handle exceptions that may occur when creating a streaming response. The try-except block ensures that any exceptions are caught and an appropriate response is returned. Additionally, the SSE response has been improved by adding a valid flag and node id to the response. This provides more information to the client about the status of the node build and allows for better error handling. 🐛 fix(chat.py): handle exceptions when creating a streaming response
Gabriel Luiz Freitas Almeida
2023-06-12 13:03:46 -03:00
806d815a10✨ feat(index.tsx): add support for streaming build process using EventSource The commented out code for the /build/{client_id} endpoint has been removed as it is no longer needed. The new implementation uses the /build/init endpoint to initiate the build process and then establishes an SSE connection using EventSource to stream the build process. This allows for a more efficient and responsive build process as the client can receive updates in real-time. 🔥 chore(chat.py, index.tsx): remove commented out code for /build/{client_id} endpoint
Gabriel Luiz Freitas Almeida
2023-06-12 11:49:59 -03:00
76f1aa8adf🐛 fix(chat.py): add check for client_id in in_memory_cache before handling websocket ✨ feat(chat.py): add support for storing graph data and returning a unique session ID for building langchain object ✨ feat(chat.py): add support for streaming the build process based on stored flow data The fix adds a check for the client_id in the in_memory_cache before handling the websocket. This ensures that the flow has been built before sending messages.
Gabriel Luiz Freitas Almeida
2023-06-12 11:49:24 -03:00
bcff7a42eb🔥 chore(test_websocket.py): remove unused import The import statement for TestClient is unused and can be safely removed.
Gabriel Luiz Freitas Almeida
2023-06-12 10:44:03 -03:00
5fe1435f9e🔥 chore(test_websocket.py): remove unused imports The imports for json and patch were not used in the file and were removed to improve code readability and maintainability.
Gabriel Luiz Freitas Almeida
2023-06-12 09:55:48 -03:00
4485f55d53🔥 chore(test_websocket.py): remove outdated test_chat_history test The test_chat_history test is outdated and no longer works with the current implementation of the application. It has been removed to avoid confusion and to keep the test suite clean.
Gabriel Luiz Freitas Almeida
2023-06-12 09:51:32 -03:00
6b57e20504formatting
Gabriel Luiz Freitas Almeida
2023-06-12 09:45:28 -03:00
4f4a0ff4c7🔨 refactor(chatComponent): refactor handleBuild function to use async/await and extract constants to improve readability 🐛 fix(chatComponent): fix issue with progressEvent not being properly destructured 🚀 feat(chatComponent): add minimum loading time to improve user experience The handleBuild function was refactored to use async/await and constants were extracted to improve readability. The issue with progressEvent not being properly destructured was fixed. A minimum loading time was added to improve user experience by ensuring that the loading spinner is displayed for at least a certain amount of time.
Gabriel Luiz Freitas Almeida
2023-06-12 09:44:12 -03:00
42d11894a2🔀 chore(base.py): change return type of generator_build method from List[Vertex] to Generator The return type of the generator_build method has been changed from List[Vertex] to Generator to improve the semantics of the method. The method now yields each vertex in the graph instead of returning a list of vertices.
Gabriel Luiz Freitas Almeida
2023-06-12 09:35:19 -03:00
a15cc30da5🔥 refactor(manager.py): remove unused imports and dependencies 🔥 refactor(utils.py): remove unused imports and dependencies The changes remove unused imports and dependencies from the codebase, which improves the code's readability and maintainability.
Gabriel Luiz Freitas Almeida
2023-06-12 09:33:54 -03:00
25f22ae88c🔇 chore(frontend): comment out console.log statements The console.log statements were commented out in the tabsContext.tsx, EditNodeModal/index.tsx, NodeToolbarComponent/index.tsx, and FlowPage/index.tsx files to remove unnecessary logging in the console.
Gabriel Luiz Freitas Almeida
2023-06-12 09:33:03 -03:00
68288be80efeat (GenericNode): replace validation with SSE validation
Gabriel Luiz Freitas Almeida
2023-06-12 09:31:43 -03:00
eaae1dda27✨ feat(chatComponent): add SSE context to update data in real-time The handleBuild function has been refactored to process data in chunks instead of waiting for the entire response to be received. This improves the performance of the function and allows for real-time updates. The SSE context has been added to update the data in real-time as it is received. 🔨 refactor(chatComponent): refactor handleBuild function to process data in chunks
Gabriel Luiz Freitas Almeida
2023-06-12 09:31:01 -03:00
42d5a501bb🚀 feat(App.tsx): add SSEProvider to App component 🎉 feat(SSEContext.tsx): add SSEContext and SSEProvider components to handle server-sent events The SSEProvider component was added to the App component to provide the SSEContext to the TabsManagerComponent. The SSEContext component was also added to handle server-sent events. The SSEContext component provides a way to update the sseData state and to access the sseData state from any component that uses the useSSE hook.
Gabriel Luiz Freitas Almeida
2023-06-12 09:30:47 -03:00
036818e9b9🔧 refactor(chat.py): rename post_build to stream_build to improve semantics 🐛 fix(chat.py): fix generator_build method to yield node_repr and node_id ✨ feat(chat.py): add valid and id fields to error response to improve error handling 🔧 refactor(manager.py): change logger.exception to logger.error to log exceptions 🔧 refactor(graph/base.py): add logging to generator_build method to improve debugging 🔧 refactor(vertex/base.py): rename cache.base to cache.utils to improve semantics The post_build method in chat.py was renamed to stream_build to better reflect its functionality. The generator_build method in graph/base.py was fixed to yield node_repr and node_id instead of node._built_object_repr() and node.id. The error response in chat.py now includes valid and id fields to improve error handling. logger.exception in manager.py was changed to logger.error to log exceptions. The generator_build method in graph/base.py now logs the sorted vertices to improve debugging. The cache.base module in vertex/base.py was renamed to cache.utils to better reflect its functionality.
Gabriel Luiz Freitas Almeida
2023-06-12 09:30:20 -03:00
273f452f7b🔧 chore(chat.py): add SSE support to post_build endpoint ✨ feat(chat.py): add SSE support to post_build endpoint to stream build progress to the client The post_build endpoint now returns a StreamingResponse object that streams Server-Sent Events (SSE) to the client. This allows the client to receive build progress updates in real-time. The event_stream function is responsible for generating the SSE events and is called by the StreamingResponse object. The SSE events contain information about the build progress, including whether the build was successful or not, the parameters used to build each node, and the node ID. The chat_manager.set_cache method is called to cache the built graph object.
Gabriel Luiz Freitas Almeida
2023-06-12 07:50:00 -03:00
76a49c8663🐛 fix(manager.py): change status parameter type from status to int in close_connection method 🔥 refactor(manager.py): remove unused build method and rename set_cache to set_client_cache 🚀 chore(manager.py): add async keyword to close_connection method The close_connection method now accepts an integer as the status parameter instead of a status enum. The build method was removed as it was not being used. The set_cache method was renamed to set_client_cache to improve semantics. The close_connection method was updated to be an async method.
Gabriel Luiz Freitas Almeida
2023-06-12 07:49:49 -03:00
9ebd02e331🚀 feat(base.py): add topological_sort method to perform a topological sort of the vertices in the graph 🚀 feat(base.py): add generator_build method to build each node in the graph and yield it The topological_sort method performs a topological sort of the vertices in the graph, returning a list of vertices in topological order. The generator_build method builds each node in the graph and yields it. These methods are useful for building the graph in a specific order, which is important for certain algorithms that rely on the order of the nodes.
Gabriel Luiz Freitas Almeida
2023-06-12 07:49:35 -03:00
5fe4ac6ffa🔇 chore(frontend): comment out console.log statements The console.log statements were commented out in the following files: - src/frontend/src/components/intComponent/index.tsx - src/frontend/src/contexts/tabsContext.tsx - src/frontend/src/modals/EditNodeModal/index.tsx - src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx - src/frontend/src/pages/FlowPage/index.tsx
Gabriel Luiz Freitas Almeida
2023-06-12 07:05:00 -03:00
a65a88ca45🐛 fix(vite.config.ts): update validate route to use regex pattern The validate route was updated to use a regex pattern instead of a string pattern to match all routes that start with "/api/v1/validate/". This change ensures that all routes that match the pattern are correctly routed to the validate endpoint.
Gabriel Luiz Freitas Almeida
2023-06-12 07:03:16 -03:00
f88b14f33d🚀 feat(chatComponent): add build trigger component to allow users to build a flow ✨ feat(chatComponent): add loading animation to build trigger component The BuildTrigger component is added to the chatComponent to allow users to build a flow. The component is triggered by clicking on a button and sends a POST request to the server to build the flow. A loading animation is added to the component to indicate that the flow is being built. The postBuild function is added to the API controller to handle the POST request.
Gabriel Luiz Freitas Almeida
2023-06-11 18:09:17 -03:00
2c0a9aee95🚸 chore(chatTrigger): add error message when chat is triggered before flow is built ✨ feat(chatComponent): add BuildTrigger component to check if flow is built before showing ChatTrigger component The ChatTrigger component now checks if the flow is built before allowing the user to open the chat. If the flow is not built, an error message is displayed instead. The BuildTrigger component is added to check if the flow is built before showing the ChatTrigger component. This improves the user experience by preventing the user from opening the chat before the flow is built.
Gabriel Luiz Freitas Almeida
2023-06-11 18:08:52 -03:00
395af24101🚀 chore(vite.config.ts): add build route to apiRoutes array The build route was added to the apiRoutes array to allow the frontend to access the build files.
Gabriel Luiz Freitas Almeida
2023-06-11 18:08:35 -03:00
f2e4a93df5🐛 fix(base.py): remove unused import of logger 🎨 refactor(run.py): update import statement for compute_dict_hash, load_cache, and memoize_dict The import of logger in base.py was not being used, so it was removed to improve code readability. In run.py, the import statement for compute_dict_hash, load_cache, and memoize_dict was updated to reflect the new location of these functions in the cache.utils module. This improves the organization of the code and makes it easier to find the relevant functions.
Gabriel Luiz Freitas Almeida
2023-06-11 18:08:20 -03:00
ccf9477b7f🐛 fix(manager.py): add check for langchain object in process_message to avoid errors ✨ feat(manager.py): add build method to build langchain object and store it in an in-memory cache The process_message method now checks if the langchain object has been built and stored in the in-memory cache before processing the message. If the object is not found, the connection is closed with an error message. A new build method has been added to build the langchain object and store it in an in-memory cache. This method is called before processing any messages.
Gabriel Luiz Freitas Almeida
2023-06-11 18:08:01 -03:00
dacc90d901🐛 fix(cache/manager.py): change CACHE variable to _cache to follow naming conventions ✨ feat(cache/utils.py): add support for clearing old cache files and memoization of dictionary functions The CACHE variable in CacheManager class has been renamed to _cache to follow naming conventions. The utils.py module now supports clearing old cache files and memoization of dictionary functions. The clear_old_cache_files function removes old cache files if the number of cache files exceeds the max_cache_size. The memoize_dict decorator memoizes dictionary functions and clears the cache when the clear_cache method is called.
Gabriel Luiz Freitas Almeida
2023-06-11 18:07:45 -03:00
02163cf775✨ feat(flow.py): add InMemoryCache class to implement an in-memory cache with LRU eviction policy This commit adds a new class InMemoryCache to implement an in-memory cache with a Least Recently Used (LRU) eviction policy. The cache supports setting a maximum size and expiration time for cached items. The cache is thread-safe using a threading Lock. The InMemoryCache class inherits from the BaseCache class and implements the get, set, get_or_set, delete, clear, __contains__, __getitem__, __setitem__, __delitem__, __len__, and __repr__ methods.
Gabriel Luiz Freitas Almeida
2023-06-11 18:07:28 -03:00
a27e5d58dd🔨 refactor(base.py): refactor BaseCache class to use abstract methods This commit refactors the BaseCache class to use abstract methods instead of concrete methods. This makes the class more flexible and allows for different implementations of the cache. The abstract methods include get, set, delete, clear, __contains__, __getitem__, __setitem__, and __delitem__.
Gabriel Luiz Freitas Almeida
2023-06-11 18:07:17 -03:00
bdbc46f01d🐛 fix(chat.py): add exception handling to post_build endpoint ✨ feat(cache/__init__.py): add InMemoryCache to exported modules 🔖 refactor(endpoints.py): remove unused import statement The post_build endpoint in chat.py now has exception handling to catch any errors that may occur during the build process. InMemoryCache is now exported as part of the cache module. The endpoints.py file has been refactored to remove an unused import statement.
Gabriel Luiz Freitas Almeida
2023-06-11 18:06:57 -03:00
efbdd6fee7🚀 feat(langflow): add version endpoint to API 🐛 fix(langflow): fix version import error in version endpoint The version endpoint is added to the API to allow clients to retrieve the version of the Langflow package. The version is obtained using the metadata.version function from the importlib module. In case the package metadata is not available, an empty string is returned. The version endpoint was previously returning an error due to an import error. The error is fixed by importing the __version__ variable from the langflow module.
Gabriel Luiz Freitas Almeida
2023-06-11 12:48:06 -03:00