Commit graph

4,876 commits

Author SHA1 Message Date
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
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
anovazzi1
b19565385b fix paste function 2023-10-02 15:18:58 -03:00
anovazzi1
c9d7e72a08 clone deep to avoid ctrl-z bug on ungroup component 2023-09-21 21:35:23 -03:00
anovazzi1
f63a19578b update lock file 2023-09-21 21:28:19 -03:00
anovazzi1
0192d3461d fix(chatComponent): import processFlow function from reactflowUtils to fix reference error
fix(chatComponent): update validation check to use processFlow function to correctly count nodes
fix(formModal): remove unnecessary spread operator on processFlow function call
fix(reactflowUtils): update getGroupStatus function to correctly return status based on ssData
2023-09-21 20:43:02 -03:00
Gabriel Luiz Freitas Almeida
0555c6a371 🔀 refactor(base.py): process graph data before building the graph to ensure consistency and correctness
🔀 refactor(base.py): update nodes and edges after processing graph data to reflect changes in the graph structure
2023-09-21 14:51:13 -03:00
Gabriel Luiz Freitas Almeida
aaaa21b5cb 🐛 fix(test_prompts_template.py): set "dynamic" property to True for input_variables, output_parser, partial_variables, template, template_format, and validate_template to enable dynamic behavior in prompt templates 2023-09-21 14:45:27 -03:00
Gabriel Luiz Freitas Almeida
3ea079e562 🚀 feat: add Basic Chat with Prompt and History node
ℹ️ This commit adds a new node called "Basic Chat with Prompt and History" to the project. This node is a simple chat implementation with a custom prompt template and a conversational memory buffer.

The node has the following properties:
- Width: 384
- Height: 621
- ID: ChatOpenAI-N0ogT
- Type: genericNode
- Position: {x: 148.32546232493678, y: 675.5574028128048}

The node contains various configuration options for the ChatOpenAI component, including:
- Callbacks: A list of callback handlers
- Cache: A boolean indicating whether to use caching
- Client: An optional client object
- Max retries: The maximum number of retries
- Max tokens: The maximum number of tokens for the chat response (password field)
- Metadata: Additional metadata for the chat
- Model kwargs: Advanced model configuration options
- Model name: The name of the model to use (options: gpt-3.5-turbo-0613, gpt-3.5-turbo, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo-16k, gpt-4-0613, gpt-4-32k-0613, gpt-4, gpt-4-32k)
- N: The number of chat responses to generate
- OpenAI API Base: The base URL of the OpenAI API
- OpenAI API Key: The API key for the OpenAI API

This node allows for creating a basic chat interface with customizable prompts and a history buffer for maintaining conversation context.

🔧 chore: update OpenAI Chat large language models API configuration
📝 docs: update documentation link for OpenAI Chat large language models API

🔧 chore: update prompt template for language model to fix formatting issue

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

The grouped_chat.json file is added to the tests/data directory. This file contains a large JSON object representing a grouped chat. It is used for testing purposes.

🚀 feat(test_graph.py): add new tests and fixtures to improve test coverage and ensure correctness of graph module functions
🐛 fix(test_graph.py): fix incorrect function name in test_find_last_node
🔧 chore(test_graph.py): refactor test_get_node_neighbors_complex to be commented out for now, as it is incomplete and causing test failures
2023-09-21 14:45:16 -03:00
Gabriel Luiz Freitas Almeida
7b90c6a61f 📦 chore(conftest.py): add fixture and example file for grouped chat JSON data
🔧 refactor(conftest.py): rename fixture `json_flow` to `openapi_json_flow` for better clarity and consistency
2023-09-21 14:44:34 -03:00
Gabriel Luiz Freitas Almeida
72f64caa41 🐛 fix(base.py): import process_flow function to fix NameError in Graph class
 feat(utils.py): add process_flow function to recursively process and ungroup nodes in a flow object
2023-09-21 14:44:10 -03:00
Gabriel Luiz Freitas Almeida
6ec51a0d22 🔀 refactor(endpoints.py): rename process_flow function to process for better naming consistency and clarity 2023-09-21 14:43:47 -03:00
Gabriel Luiz Freitas Almeida
ddd480fb23 🐛 fix(tabsContext.tsx): handle null or undefined flow.description to prevent potential errors 2023-09-21 12:57:08 -03:00
anovazzi1
d9073aba39 refactor(tabsContext.tsx): rename processFlowEdges and processFlowNodes functions to processDataFromFlow to improve clarity and consistency
refactor(tabsContext.tsx): remove console.log statement for old edges
refactor(tabsContext.tsx): add comments to indicate updating edges colors and baseclasses in edges
refactor(tabsContext.tsx): add comments to indicate updating baseclasses in edges
refactor(tabsContext.tsx): add comments to indicate adding animation to text type edges
refactor(tabsContext.tsx): update updateIds function to handle GroupNode type nodes
refactor(reactflowUtils.ts): update updateIds function to handle GroupNode type nodes
refactor(reactflowUtils.ts): update updateIds function to handle sourceHandle and targetHandle ids in edges
2023-09-21 10:56:50 -03:00
anovazzi1
bf1597a9f4 refactor(tabsContext.tsx): simplify code in TabsProvider component
The changes in this commit simplify the code in the TabsProvider component in the tabsContext.tsx file. Here's a summary of the changes:

- In the `createNewFlow` function, the `flowData` parameter is now of type `ReactFlowJsonObject | null` instead of `{ data: ReactFlowJsonObject | null; description: string }`. This simplifies the function signature and removes the need for destructuring the `flowData` object.
- The `extractDataFromFlow` function has been renamed to `processDataFromFlow` to better reflect its purpose. The function now returns only the `data` property from the `flow` object instead of an object with `data` and `description` properties.
- The `description` property in the `createNewFlow` function is now set to `flow.description ?? getRandomDescription()`. This ensures that if the `flow` object has a `description` property, it is used, otherwise a random description is generated.
- The `processFlowEdges` and `processFlowNodes` functions are no longer called in the `createNewFlow` function. It seems that these functions are defined elsewhere and are not necessary in this context.

These changes simplify the code and improve readability by removing unnecessary checks and simplifying function signatures.
2023-09-21 10:30:59 -03:00
anovazzi1
577046523a fix(tabsContext.tsx): change parameter type of newProject in uploadFlow function from optional boolean to required boolean to improve clarity and prevent potential bugs
fix(tabsContext.tsx): change parameter type of newProject in addFlow function from optional Boolean to required Boolean to improve clarity and prevent potential bugs
fix(extraSidebarComponent/index.tsx): change argument of uploadFlow function from undefined to false to fix a bug where uploadFlow was not being called correctly
fix(tabs/index.ts): change parameter type of newFlow in uploadFlow function from optional boolean to required boolean to improve clarity and prevent potential bugs
2023-09-21 10:08:12 -03:00
anovazzi1
fbb6f0839a skip groupNode from node update 2023-09-20 23:22:17 -03:00
anovazzi1
7bc3f9ed30 skip groupNode from node update 2023-09-20 23:19:53 -03:00
anovazzi1
6e609c8dd0 fix(PageComponent): fix initial state of selectionEnded to be true instead of false to prevent unnecessary re-rendering 2023-09-18 20:38:56 -03:00
anovazzi1
fda2047fec code format 2023-09-18 20:37:01 -03:00
anovazzi1
1a8d522236 fix(reactflowUtils.ts): update generated node id to include "GroupNode" prefix for better identification
fix(utils.ts): truncate component name and display name to 15 characters for better readability
2023-09-18 20:36:29 -03:00
anovazzi1
fe85435488 format 2023-09-18 20:26:32 -03:00
anovazzi1
9e01aa1580 fix(parameterComponent): import extractIdFromLongId function to fix missing reference error
feat(parameterComponent): add proxy prop to ParameterComponentType to pass proxy information to the component
feat(GenericNode): pass proxy information from node template to ParameterComponent
feat(types): add proxy field to proxy object in ParameterComponentType
fix(reactflowUtils): remove unnecessary code for extracting node id
2023-09-18 20:25:42 -03:00
anovazzi1
59cd201ad9 refactor(GenericNode/index.tsx): use data from API response to display node name and description instead of local variables
The changes were made to improve consistency and ensure that the displayed node name and description are always in sync with the data received from the API response. By using the `data.node?.display_name` and `data.node?.description` properties, we can dynamically update the node name and description without relying on local variables. This also allows for easier maintenance and reduces the risk of displaying outdated or incorrect information.
2023-09-18 19:48:14 -03:00
anovazzi1
15a2c95351 fix(PageComponent): update validateSelection function to include edges in the selection if only nodes are selected 2023-09-18 19:32:24 -03:00
anovazzi1
3fc08cee93 chore(reactflowUtils.ts): add condition to hide code template with CustomComponent proxy in updateGroupNodeTemplate function
The code in the updateGroupNodeTemplate function has been modified to include a condition that checks if the type is "code" and if the template's proxy ID includes "CustomComponent". If both conditions are met, the show property of the template is set to false. This change was made to hide the code template with the CustomComponent proxy in the React Flow application.
2023-09-18 18:44:42 -03:00
anovazzi1
c61f622612 refactor(reactflowUtils.ts): import additional utility functions and update function calls to match new function names
fix(reactflowUtils.ts): update mergeNodeTemplates function to include truncated display name and extracted id in template key
feat(utils.ts): add utility functions to extract id from long id and truncate display name
2023-09-18 18:43:15 -03:00
anovazzi1
3305983cc4 refactor(reactflowUtils.ts): extract duplicated code into a helper function to improve readability and maintainability
fix(reactflowUtils.ts): fix typo in function name scapedJSONStringfy to escapedJSONStringify
fix(reactflowUtils.ts): fix typo in function name customStringify to escapedJSONStringify
feat(reactflowUtils.ts): add inputTypes property to targetHandleType to improve functionality and accuracy of handle connection check
2023-09-18 18:21:09 -03:00
anovazzi1
44b6171800 remove console.log 2023-09-14 22:31:59 -03:00
anovazzi1
be1ee757a4 fix(parameterComponent): add readonly prop to CodeAreaComponent and PromptAreaComponent based on dynamic property in template
fix(GenericNode): remove console.log statement
fix(codeAreaComponent): add readonly prop to CodeAreaModal
fix(codeTabsComponent): add readonly prop to CodeAreaComponent and PromptAreaComponent
fix(promptComponent): add readonly prop to GenericModal
fix(EditNodeModal): add readonly prop to CodeAreaComponent
fix(codeAreaModal): add readonly prop to AceEditor in CodeAreaModal
fix(genericModal): add readonly prop to Textarea in GenericModal
fix(reactflowUtils): remove unnecessary code in updateGroupNodeTemplate function
2023-09-14 22:31:21 -03:00
anovazzi1
a273aab2cc fix(types): add 'readonly' property to TemplateVariableType to indicate if a variable is read-only
fix(types): add 'selected' property to NodeType to indicate if a node is selected
fix(reactflowUtils): change 'dynamic' property to 'readonly' when updating group node template
fix(reactflowUtils): update group node template fields with correct values and set 'selected' property to false
2023-09-14 21:51:55 -03:00
anovazzi1
9647fe0b69 fix bug on infinity icon 2023-09-14 21:17:23 -03:00
anovazzi1
b65b3ce89a fix(EditNodeModal): update the display of the node type in the modal header to use the display name instead of the type property for better clarity and accuracy 2023-09-14 20:58:31 -03:00
anovazzi1
c0befa83ac fix(reactflowUtils.ts): only add updated edges to the array if they are connected to the group node 2023-09-14 20:47:36 -03:00
anovazzi1
c5d9a390eb fix(reactflowUtils.ts): add missing assignment of newSourceHandle to newEdge.data.sourceHandle to ensure data consistency
fix(reactflowUtils.ts): add missing assignment of newTargetHandle to newEdge.data.targetHandle to ensure data consistency
2023-09-14 20:34:19 -03:00
anovazzi1
4cdd66d1d3 fix(reactflowUtils.ts): add missing assignment of newSourceHandle to newEdge.data.sourceHandle to ensure data consistency
fix(reactflowUtils.ts): add missing assignment of newTargetHandle to newEdge.data.targetHandle to ensure data consistency
2023-09-14 20:22:29 -03:00