🐛 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.
The useEffect hook was added to the PageComponent to save the flow when the component unmounts if the flow is pending. This is done to ensure that any changes made to the flow are saved before the component is unmounted. The tabsState and saveFlow functions were also added as dependencies to the hook.
feat(flowSettingsModal/index.tsx): use saveFlow function from TabsContext to save flow changes to database and update state
feat(extraSidebarComponent/index.tsx): use saveFlow function from TabsContext to save flow changes to database and update state
feat(tabs/index.ts): add saveFlow function to TabsContextType to update type definition
The activeTab state was previously a number, but it was causing a type error when passed as a prop to the TabsTrigger component. Changing it to a string fixed the issue. Additionally, the onValueChange prop was added to the Tabs component to update the activeTab state when a new tab is selected.
🐛 fix(ApiModal): change activeTab state from number to string to fix type error
This commit adds a new function called getWebSocketUrl to the ChatModal component. This function generates a WebSocket URL based on the chatId and environment. It determines whether to use the "ws" or "wss" protocol based on whether the current protocol is secure or not. It also determines the host based on whether the environment is development or production. This function will be used to establish a WebSocket connection to the server.
The Save button was not being displayed correctly when the isPending variable was true. The fix changes the order of the classes to correctly display the button as intended.
The 'valid' state variable was not being used, so it was removed. The 'streamNodeData' function was simplified by removing the 'onStreamComplete' callback and instead using a while loop to wait for the stream to finish. The function now returns a boolean indicating whether all nodes in the flow are valid or not.
The updateFlowInDatabase function now has a type added to it, which improves the readability of the code. The code has also been formatted to improve consistency with the rest of the codebase.
🔨 refactor(parameterComponent): remove unused imports and refactor onChange function to handleOnNewValue
✨ feat(tabsContext): add tabsState and setTabsState to TabsContextType and TabsProvider
🔨 refactor(flowSettingsModal): refactor handleSaveFlow function to update flow and setTabsState with isPending false
The update_flow endpoint now returns a FlowRead response model instead of FlowReadWithStyle. The parameterComponent file has been refactored to remove unused imports and to use a handleOnNewValue function to handle onChange events. The TabsContextType and TabsProvider have been updated to include tabsState and setTabsState. The flowSettingsModal has been refactored to update the flow and setTabsState with isPending false.
🔨 refactor(extraSidebarComponent): add tabsState and setTabsState to TabsContextType
🐛 fix(extraSidebarComponent): disable save button when flow is not pending
🐛 fix(extraSidebarComponent): update flow state after saving
The TabsContextType now includes tabsState and setTabsState to allow for the management of the state of each tab. The save button is now disabled when the flow is not pending. The flow state is now updated after saving to reflect the changes made.