🐛 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.
refactor(App.tsx): remove redundant code that initializes the version state variable and fetches the version number from the API in FlowPage component instead
The menu bar has been refactored to improve readability and make it easier to add new options in the future. A new option has been added to create a new flow. The "Edit" label has been changed to "Options" to better reflect the purpose of the dropdown menu.
The constructor of VectorStoreRouterAgent expects a non-list object for vectorstoreroutertoolkit. However, in some cases, vectorstoreroutertoolkit is already a list. This commit fixes the issue by checking if vectorstoreroutertoolkit is a list and using it directly if it is.
The cachetools package is added as a dependency to improve caching. In chat.py, a ValueError is raised if no ID is provided in init_build to prevent errors. The flow_data_store dictionary is replaced with an LRUCache from cachetools to limit the size of the cache to 10 items. This improves performance by reducing the memory usage of the application.
📦 chore(pyproject.toml): add cachetools dependency to improve caching
🐛 fix(chat.py): raise ValueError if no ID is provided in init_build
🐛 fix(endpoints.py): add check for flow data before processing
🔨 refactor(process.py): add type hints to process_tweaks function
The get_flow_from_token function and HTTPBearer import are removed as they are not used in the code. A check for flow data is added before processing to avoid errors when the flow data is None. The process_tweaks function is updated to include type hints for the graph_data and tweaks parameters.
🔥 refactor(utils/validate.py): remove try-except block in create_function method
The pass statement in the BaseCache abstract method is redundant and can be removed. Similarly, the try-except block in the create_function method is not necessary as the exception is being suppressed.
The CSS file has been reformatted to improve readability and consistency. The changes include indentation, whitespace, and line breaks. No functional changes have been made to the code.
The isBuilding state was added to the SSEContext to keep track of whether a build is currently in progress. This state was then used in the GenericNode and BuildTrigger components to conditionally render certain elements based on whether a build is in progress or not.
The name and display_name of the InitializeAgentNode class have been changed to "AgentInitializer" and "AgentInitializer" respectively. This improves the readability of the code and makes it easier to understand the purpose of the class.
The "initialize_agent" key in the CUSTOM_AGENTS dictionary has been renamed to "AgentInitializer" to improve naming consistency with the other agents in the dictionary.
🐛 fix(utils.ts): fix import statement for ADJECTIVES, DESCRIPTIONS, and NOUNS constants
The constants.tsx file now contains arrays of adjectives, nouns, and descriptions that can be used to generate random names and descriptions for new flows. The tabsContext.tsx file now has functions that use these arrays to generate random names and descriptions for new flows. The utils.ts file has been updated to fix the import statement for the ADJECTIVES, DESCRIPTIONS, and NOUNS constants.
✨ feat(constants.tsx): add arrays of adjectives, nouns, and descriptions for generating random names and descriptions
🔨 refactor(chains.py): comment out unused code block
The `from_method_nodes` dictionary in `base.py` has been updated to include the `LLMCheckerChain` class. This allows the `from_llm` method to be called on the `LLMCheckerChain` class.
The code block in `chains.py` that deals with the `PromptTemplate` field type has been commented out as it is currently unused. This is to prevent confusion and to keep the codebase clean.
- The code changes consist of modifying the CSS classes of the chat and build trigger buttons, adjusting the hover effects, shadows and icon colors to make them more visually appealing.
The imports for ForwardRefExoticComponent, ReactElement, ReactFragment, ReactNode, and SVGProps were not being used in the file, so they were removed to improve code readability and maintainability.
The create_app function now accepts a static_path parameter that defaults to "static". The setup_static_files function is created to mount the static files directory to the app. A custom 404 handler is added to the app to return the index.html file when a 404 error occurs. This allows the app to serve static files such as HTML, CSS, and JavaScript files.
🚀 feat(__main__.py, main.py): add support for serving static files
✨ feat(__main__.py): create a setup_static_files function to mount the static files directory to the app
The `save_api_keys` variable has been renamed to `remove_api_keys` to improve the semantics of the code. The new variable name better reflects the functionality of the code, which is to remove API keys from the projects saved in the database.
🔧 chore(__main__.py): change save_api_keys to remove_api_keys to improve semantics
✨ feat(__main__.py): add save_api_keys parameter to serve command to allow users to save API keys in their projects
The update_settings function now accepts a save_api_keys parameter, which allows the user to specify whether or not to save API keys in their projects. The serve command now has a save_api_keys parameter that defaults to True, allowing users to save API keys in their projects. This feature improves the user experience by allowing them to save API keys for future use.
This commit adds a new function called `remove_api_keys` to the `utils.py` file. The function takes in a dictionary representing a flow and removes any API keys from the flow data. The function iterates through each node in the flow and checks if the node contains any API keys. If an API key is found, the function sets the value of the key to `None`. This function is useful for removing sensitive information from flow data before it is stored or transmitted.
The `remove_api_keys` function is now called on the `flow_data` dictionary if the `save_api_keys` setting is False. This ensures that sensitive information is not saved in the database.
The condition to show the password field was not working for the 'tokens' field name. The condition has been updated to include 'tokens' in the field name and show the password field.
The TWEAKS constant is a dictionary that can be used to tweak the flow. It is an optional parameter that can be passed to the run_flow function. The dictionary should be in the format {"OpenAI-XXXXX": {"model_name": "gpt-4"}}. This commit adds documentation to the code to make it easier for developers to understand how to use the TWEAKS constant.
This commit changes the styling of the build trigger button in the Chat Component. The button is now round and has a shadow when hovering. Additionally, the lightning bolt icon is now colored with a gradient rather than a solid color.