Commit graph

5,654 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
44bebf7d6b Merge remote-tracking branch 'origin/dev' into newGroupNode 2023-10-09 10:48:35 -03:00
Gabriel Luiz Freitas Almeida
8eae2fa126 🔍 test(graph.py): add assertions to verify expected keywords in source and target fields of processed_flow edges
The test_process_flow_vector_store_grouped function now includes assertions to check if the expected keywords are present in the source and target fields of the edges in the processed_flow dictionary. This ensures that the processing of the flow vector store grouped JSON is correctly generating the edges with the expected connections between nodes.
2023-10-09 10:41:54 -03:00
Gabriel Luiz Freitas Almeida
6f1306887a 🔧 chore(Makefile): simplify frontend target by combining install_frontend and run_frontend commands
🐛 fix(Makefile): handle error in install_frontend command and attempt to fix it by running install_frontendc
🔧 chore(Makefile): simplify backend target by combining install_backend and run_backend commands
 feat(Makefile): add support for login flag to control autologin feature in backend command
2023-10-08 18:44:08 -03:00
Gabriel Luiz Freitas Almeida
419822211f 🔀 chore(README.md): update GIF link to point to the correct branch (dev) to ensure the latest demo is displayed 2023-10-08 18:01:05 -03:00
Gabriel Luiz Freitas Almeida
1ce520026a Fix langflow gif 2023-10-08 17:57:40 -03:00
Gabriel Luiz Freitas Almeida
c941099275 🐛 fix(Makefile): fix typo in make target name 'install_frontendc' to 'install_frontend' to resolve error during frontend installation
 feat(Makefile): add error handling to retry frontend installation if it fails to ensure successful installation
🐛 fix(Makefile): fix typo in make target name 'install_frontendc' to 'install_frontend' to resolve error during frontend installation
 feat(Makefile): add support for running backend with or without autologin based on the value of the 'autologin' variable
2023-10-08 17:50:14 -03:00
Gabriel Luiz Freitas Almeida
61a5c9dcdb 🐛 fix(utils.py): improve error handling in initialize_database() function
The `initialize_database()` function now handles two specific exceptions: "overlaps with other requested revisions" and "Can't locate revision identified by". If either of these exceptions occur, they will not be raised and instead the `alembic_version` table will be deleted. This change improves the error handling and ensures that the database is properly initialized.
2023-10-07 12:03:51 -03:00
anovazzi1
be5060b5f7 fix handle on groupNod for minification 2023-10-06 19:48:00 -03:00
anovazzi1
c30026743a feat(tests): add end-to-end tests for Flow Page and Group component
Add end-to-end tests for the Flow Page and Group component in the frontend. The Flow Page tests include a test for saving a custom component and verifying the success alert. The Group component tests include tests for grouping and ungrouping components, editing component properties, and verifying the changes.
2023-10-06 19:12:35 -03:00
anovazzi1
533e4cc47f remove 'null' test value 2023-10-06 17:43:48 -03:00
anovazzi1
2c594894e0 fix(ui/tooltip.tsx): add z-index to tooltip content to ensure it appears above other elements
feat(modals/EditNodeModal/index.tsx): add ShadTooltip component to display tooltip content for template parameters
2023-10-06 17:38:07 -03:00
Gabriel Luiz Freitas Almeida
7a1f06128e 🐛 fix(base.py): fix type hint for nodes parameter in Graph class constructor to improve code readability and maintainability
🔀 refactor(base.py): refactor initialization of top_level_nodes list in Graph class constructor to improve code readability and maintainability
2023-10-06 16:59:29 -03:00
Gabriel Luiz Freitas Almeida
4d6c731a9d 🐛 fix(base.py): change assignment of source_handle and target_handle to use get() method to handle missing keys gracefully
🐛 fix(base.py): change assignment of parent_node_id and parent_is_top_level to use state dictionary instead of _data attribute
🐛 fix(test_graph.py): change arguments passed to update_source_handle() function to match its signature
2023-10-06 16:19:42 -03:00
anovazzi1
1eca5bd40a fix(reactflowUtils.ts): add support for "dict" and "NestedDict" types in updateGroupNodeTemplate function
The updateGroupNodeTemplate function was updated to include support for the "dict" and "NestedDict" types. This allows the function to properly handle these types when checking if they are required or not.
2023-10-06 16:03:26 -03:00
anovazzi1
98afa2192b update poetry lock and package-lock 2023-10-06 15:46:00 -03:00
anovazzi1
88d91c48d8 Merge remote-tracking branch 'origin/dev' into NGNMergeDev 2023-10-06 15:41:42 -03:00
anovazzi1
dbcd19762a update display name of group node 2023-10-06 12:12:21 -03:00
anovazzi1
3d301a683c fix(GenericNode): update the name prop of IconComponent to conditionally display "Ungroup" if data.node.flow is truthy
fix(reactflowUtils): update the display_name value to "group Component" in the generateNodeFromFlow function

The changes were made to improve the semantics and provide more descriptive names for better understanding and maintainability.
2023-10-05 20:09:52 -03:00
anovazzi1
e97a600ca3 remove console.log 2023-10-05 19:51:35 -03:00
anovazzi1
56fce07318 refactor(reactflowUtils.ts): simplify logic for adding edges to selection in validateSelection function
fix(reactflowUtils.ts): filter edges in validateSelection function based on nodes in the selection to ensure only connected edges are added
2023-10-05 19:51:16 -03:00
Gabriel Luiz Freitas Almeida
c7f8606a72 ⬆️ chore(pyproject.toml): update pandas dependency to version 2.0.3 for compatibility and bug fixes 2023-10-05 18:41:55 -03:00
Gabriel Luiz Freitas Almeida
82ad45847f 🔖 chore(pyproject.toml): bump version from 0.5.0 to 0.5.1 to indicate a new release with updates and bug fixes 2023-10-05 18:27:30 -03:00
anovazzi1
0b1f837c2a fix(api.tsx): remove unnecessary try-catch block and add error logging for better debugging
fix(index.ts): remove console.log statement for error logging
2023-10-05 18:27:30 -03:00
anovazzi1
37f35806a6 fix(formModal/index.tsx): update updateLastMessage function to include prompt value when data.type is "end"
fix(formModal/index.tsx): update template.current value when data.type is "prompt" and data.prompt is provided
fix(formModal/index.tsx): remove unnecessary updateLastMessage call when data.type is "stream" and isStream is true
2023-10-05 18:27:30 -03:00
Gabriel Luiz Freitas Almeida
c3197c30f5 🐛 fix(manager.py): change try-except block to if-elif block to improve code readability and maintainability 2023-10-05 18:27:30 -03:00
Gabriel Luiz Freitas Almeida
aec14bd250 🐛 fix(manager.py): remove unnecessary exception handling and logging for JSON decoding error
🐛 fix(manager.py): fix condition for clearing chat history to only clear if "clear_history" key is present and its value is truthy
2023-10-05 18:27:30 -03:00
Gabriel Luiz Freitas Almeida
10d79fcbec 🔧 refactor(buildTrigger/index.tsx): remove unused processFlow function to improve code readability and maintainability
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'finished' variable and while loop to simplify code logic
🔧 refactor(buildTrigger/index.tsx): remove unnecessary return statement and resolve/reject promises directly to improve code readability
🔧 refactor(buildTrigger/index.tsx): remove unused 'isValid' variable and directly push validation results to 'validationResults' array
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'else' statements and simplify code logic
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'setProgress' function call and directly set progress value
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'setSuccessData' and 'setErrorData' function calls and directly set success and error data values
🔧 refactor(buildTrigger/index.tsx): remove unnecessary type assertion for 'setTabsState' function call
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'setIsBuilding' function call
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'eventSource.close()' function call in 'onerror' event handler
🔧 refactor(buildTrigger/index.tsx): remove unnecessary 'resolve' function call in 'onmessage' event handler
2023-10-05 14:49:58 -03:00
Gabriel Luiz Freitas Almeida
06bbfa2e04 🐛 fix(utils.py): fix find_last_node function to receive nodes and edges as arguments instead of data dictionary
🐛 fix(utils.py): fix update_source_handle function to receive g_nodes and g_edges as arguments instead of flow_data
🐛 fix(utils.py): fix get_updated_edges function to receive g_nodes and g_edges as arguments instead of base_flow and group_node_id
 feat(utils.py): add support for passing nodes and edges as arguments to find_last_node, update_source_handle, and get_updated_edges functions to improve reusability and modularity
2023-10-05 13:08:09 -03:00
Gabriel Luiz Freitas Almeida
01438d82e0 🐛 fix(base.py): add exception logging to provide more information in case of KeyError
🐛 fix(utils.py): fix bug where ungrouped nodes were not added to the queue for future processing
 feat(utils.py): add functionality to keep track of processed nodes to avoid duplicate processing
 feat(utils.py): add functionality to process nodes in a breadth-first manner to ensure correct order of processing
 feat(utils.py): add functionality to update source handles correctly when ungrouping nodes
2023-10-05 12:34:54 -03:00
Gabriel Luiz Freitas Almeida
58548cc242 🔧 chore(conftest.py): add new fixture for vector_store_grouped_json_flow to improve test coverage
🔧 chore(conftest.py): add new path for vector_store_grouped.json file to improve test coverage

🆕 feat(Vector Store): add Vector Store agent and Vector Store Info node

The Vector Store agent allows querying a Vector Store. It can be used to construct an agent from a Vector Store. The Vector Store Info node provides information about a Vector Store.

The Vector Store agent and Vector Store Info node are added to support the functionality of querying a Vector Store.

🔧 chore: update configuration options in the code
📝 docs: add information about the OpenAI API Base configuration option in the code comments

🔧 chore: update configuration for ChatOpenAI and Chroma nodes
📝 docs: update documentation for ChatOpenAI and Chroma nodes

🔧 chore(config): update OpenAIEmbeddings-YwSvx configuration options

The OpenAIEmbeddings-YwSvx configuration options have been updated to include new fields and values. This commit updates the configuration file to reflect these changes.

🔧 chore(config): update configuration options for OpenAIEmbeddings and Chroma

🔧 chore(config): update configuration options for OpenAIEmbeddings and Chroma to improve flexibility and customization

🔧 chore(config): update configuration options for RecursiveCharacterTextSplitter and WebBaseLoader
📝 docs(config): update configuration options for RecursiveCharacterTextSplitter and WebBaseLoader in documentation

🔧 chore(OpenAIEmbeddings): update OpenAIEmbeddings configuration options

The OpenAIEmbeddings node configuration options have been updated to include the following changes:
- `allowed_special` and `disallowed_special` now accept a list of values instead of a single value
- `chunk_size` now accepts an integer value
- `deployment` now accepts a string value
- `embedding_ctx_length` now accepts an integer value
- `headers` now supports multiline values
- `max_retries` now accepts an integer value
- `model` now accepts a string value
- `model_kwargs` now accepts code input
- `openai_api_base` now accepts a password input
- `openai_api_key` now accepts a password input
- `openai_api_type` now accepts a password input
- `openai_api_version` now accepts a password input
- `openai_organization` has been removed from the configuration options

🔧 chore: update OpenAIEmbeddings configuration options in the UI

The OpenAIEmbeddings configuration options in the UI have been updated to include the following changes:
- Added the `openai_organization` option to specify the OpenAI organization.
- Added the `openai_proxy` option to configure the OpenAI proxy.
- Added the `request_timeout` option to set the request timeout.
- Added the `show_progress_bar` option to control the display of progress bars.
- Added the `tiktoken_model_name` option to specify the Tiktoken model name.

These changes improve the flexibility and customization of the OpenAI embedding models.

🔧 chore: clean up unused code and remove unnecessary fields in the configuration file
📝 docs: update documentation link for the Chroma vectorstore module

🔧 fix: fix formatting issue in chunk_size field in RecursiveCharacterTextSplitter node configuration
🔧 fix: fix formatting issue in separator_type field in RecursiveCharacterTextSplitter node configuration
🔧 fix: fix formatting issue in separators field in RecursiveCharacterTextSplitter node configuration

📝 chore(vector_store_grouped.json): add vector_store_grouped.json test data file

🔀 chore(vector_store_grouped.json): add vector_store_grouped.json test data file

 test(graph.py): add test case for processing flow with grouped nodes and vector store
🔍 test(graph.py): add assertions to verify the correctness of the processed flow with grouped nodes and vector store
🔧 test(graph.py): update test case for updating template to make a deep copy of sample_nodes to keep it unchanged
2023-10-05 12:29:29 -03:00
Gabriel Luiz Freitas Almeida
de7c80de3f 🐛 fix(utils.py): refactor update_template function to improve readability and maintainability
 feat(utils.py): add support for nested proxy dictionary in template to handle field and id separately
 test(test_graph.py): add test cases for process_flow function to ensure correct processing of grouped chat data
 test(test_graph.py): add test cases for update_template function to ensure correct updating of template
2023-10-05 11:40:40 -03:00
Gabriel Luiz Freitas Almeida
533edf48f9 🔧 chore(conftest.py): add fixture for one_grouped_chat_json_flow to provide a test data file for one grouped chat
🔧 chore(conftest.py): add one_grouped_chat_json_flow fixture to read and return the contents of the one_group_chat.json file

📝 chore(one_group_chat.json): add one_group_chat.json test data file

This commit adds the one_group_chat.json file to the tests/data directory. The file contains a simple chat with a custom prompt template and conversational memory buffer. It is used for testing purposes.

🔧 chore: update node configuration for ConversationBufferMemory, ChatOpenAI, and LLMChain
📝 docs: update documentation links for ConversationBufferMemory and LLMChain

🔧 fix: update prompt template in LLMChain to include conversation history and text input variables
🔧 fix: update ConversationBufferMemory node to include description and documentation links

🎨 style: format and organize code for better readability and maintainability
2023-10-05 11:39:00 -03:00
anovazzi1
15a6eb58b1 refactor(reactflowUtils.ts): remove unnecessary code that hides the "code" template for CustomComponent
The code was removing the "code" template for CustomComponent by setting its "show" property to false. However, this code is no longer needed and has been removed to simplify the logic and improve maintainability.
2023-10-04 21:46:34 -03:00
anovazzi1
39ddc8eed4 update proxy field on clean edges 2023-10-04 21:12:58 -03:00
Gabriel Luiz Freitas Almeida
fb26d1fedd 🐛 fix(test_graph.py): update expected values in test_find_last_node and test_ungroup_node to reflect changes in the code 2023-10-04 20:46:32 -03:00
Gabriel Luiz Freitas Almeida
29f0fb1e15 Update grouped_chat example 2023-10-04 20:46:17 -03:00
Gabriel Luiz Freitas Almeida
20555a4e88 🐛 fix(base.py): remove unused process_flow function call in Graph class to improve code readability and performance
🐛 fix(utils.py): change condition from `node["data"]["node"]["flow"]` to `node["data"]["node"].get("flow")` to handle cases where "flow" key is missing in node data

🐛 fix(utils.py): fix incorrect variable name in get_updated_edges function, change `new_edge` to `edge` in the condition
2023-10-04 20:45:29 -03:00
anovazzi1
64dbdc0e9d fix bug on expand and ungroup that does not update connected edges with proxy 2023-10-04 20:10:33 -03:00
Gabriel Luiz Freitas Almeida
7d633d853d 🐛 fix(chat.py): remove unnecessary blank line to improve code readability
🐛 fix(chat.py): remove unused variable 'valid' to improve code readability
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py): fix indentation of 'yield' statement to match the surrounding code
🐛 fix(chat.py
2023-10-04 18:46:20 -03:00
Gabriel Luiz Freitas Almeida
bc421d7557 🐛 fix(test_agents_template.py): set "required" field to True for the "tools" attribute in the template dictionary to enforce its presence 2023-10-04 17:46:45 -03:00
Gabriel Luiz Freitas Almeida
ed61bb5b8b 🔥 refactor(test_setup_superuser.py): remove unused import and function setup_superuser to improve code readability and maintainability 2023-10-04 17:43:56 -03:00
Gabriel Luiz Freitas Almeida
7e2bce6315 ⬆️ chore(pyproject.toml): update package versions and dependencies
- Update the version of the package "langflow" from "0.5.0b6" to "0.5.0" to indicate a stable release.
- Update the version of the package "fastapi" from "^0.100.0" to "^0.103.0" to use the latest version.
- Update the version of the package "uvicorn" from "^0.22.0" to "^0.23.0" to use the latest version.
- Update the version of the package "langchain" from "^0.0.306" to "^0.0.308" to use the latest version.
- Update the version of the package "tiktoken" from "~0.4.0" to "~0.5.0" to use the latest version.
- Update the version of the package "cohere" from "^4.21.0" to "^4.27.0" to use the latest version.
- Update the version of the package "alembic" from "^1.11.2" to "^1.12.0" to use the latest version.
- Update the version of the package "metal-sdk" from "^2.0.2" to "^2.2.0" to use the latest version.

These updates ensure that the project is using the latest versions of the dependencies and takes advantage of any bug fixes or new features introduced in the updated versions.
2023-10-04 17:43:15 -03:00
Gabriel Luiz Freitas Almeida
62fc19b1e6 🔧 fix(test_setup_superuser.py): comment out unused imports and test cases to improve code readability and maintainability 2023-10-04 17:42:52 -03:00
Gabriel Luiz Freitas Almeida
3183c52594 🔧 chore(constants.py): update CLASSES_TO_REMOVE list to include "RunnableSerializable" class
The "CLASSES_TO_REMOVE" list in the constants.py file has been updated to include the "RunnableSerializable" class. This change was made to ensure that the "RunnableSerializable" class is properly removed when processing the list of classes to remove.
2023-10-04 17:42:41 -03:00
Gabriel Luiz Freitas Almeida
537e1a3e05 🔧 chore(utils.py): refactor get_factories_and_deps function to improve code organization and readability
🔧 chore(utils.py): refactor initialize_services function to use the updated get_factories_and_deps function for better maintainability
2023-10-04 17:42:26 -03:00
Gabriel Luiz Freitas Almeida
79334a10de 🔧 chore(callback.py): refactor StreamingLLMCallbackHandler constructor to improve code readability and maintainability
🐛 fix(callback.py): assign websocket attribute from chat_service.active_connections to self.websocket to avoid potential bugs
2023-10-04 17:42:12 -03:00
Gabriel Luiz Freitas Almeida
0b2cfb3bbe 🐛 fix(agents.py): change 'required' attribute of 'Tool' field in InitializeAgentNode class from False to True to enforce its presence 2023-10-04 17:24:41 -03:00
Gabriel Luiz Freitas Almeida
75319a4579 🔧 chore(alembic): import sqlmodel module to satisfy linter and improve code readability 2023-10-04 15:44:29 -03:00
anovazzi1
c9724d0fb4 added custom component template 2023-10-04 15:37:41 -03:00
anovazzi1
71bc3c4a65 formated code 2023-10-04 15:37:41 -03:00