Commit graph

2,102 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
2bd51c6104 🔥 refactor(utils.py): remove unused functions save_cache and load_cache
The functions save_cache and load_cache are not used in the codebase and can be safely removed to improve code readability and maintainability.
2023-06-16 14:31:16 -03:00
Gabriel Luiz Freitas Almeida
a099fd05ad 🔥 refactor(cache/base.py): remove empty pass statement in BaseCache abstract method
🔥 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.
2023-06-16 14:22:14 -03:00
Gabriel Luiz Freitas Almeida
93d1c10888 🎨 style(index.css): reformat CSS file to improve readability and consistency
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.
2023-06-16 14:01:31 -03:00
Gabriel Luiz Freitas Almeida
95597887b2 🔨 refactor(test_database.py): replace unused variable with underscore
The variable 'i' is not used in the for loop, so it has been replaced with an underscore to improve code readability.
2023-06-16 13:59:59 -03:00
Gabriel Luiz Freitas Almeida
5568db9f1b 🔥 refactor(base.py): remove empty pass statements in BaseCache abstract class methods
The pass statements in the BaseCache abstract class methods are redundant and can be removed as they do not add any value to the code.
2023-06-16 13:58:23 -03:00
Lucas Oliveira
2093a23547 Git button redirecting to new tab 2023-06-16 13:37:17 -03:00
anovazzi1
6abe1e6ba9 fix(alertContext.tsx): prevent empty titles from being added to notification center in setErrorData, setNoticeData and setSuccessData functions 2023-06-16 13:11:55 -03:00
anovazzi1
b47f6aa326 refactor(frontend): add isBuilding state to SSEContext and use it in GenericNode and BuildTrigger components
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.
2023-06-16 13:03:38 -03:00
Gabriel Luiz Freitas Almeida
d897de48f9 🎨 style(agents.py): change name and display_name of InitializeAgentNode to improve readability
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.
2023-06-16 12:24:41 -03:00
Gabriel Luiz Freitas Almeida
fb53522311 🚀 chore(custom.py): rename "initialize_agent" to "AgentInitializer" in CUSTOM_AGENTS dictionary
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.
2023-06-16 12:13:04 -03:00
gustavoschaedler
92a285bb2e Adjusted the name of the agent AgentInitializer to initialize_agent temporarily to fix a bug in the frontendnode 2023-06-16 15:38:20 +01:00
Gabriel Luiz Freitas Almeida
568813f9da feat(tabsContext.tsx): add functions to generate random names and descriptions for new flows
🐛 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
2023-06-16 09:38:11 -03:00
Gabriel Luiz Freitas Almeida
4faa1e7240 🔨 refactor(base.py): add LLMCheckerChain to from_method_nodes dictionary
🔨 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.
2023-06-16 08:55:38 -03:00
Lucas Oliveira
1ecc1247e7 Fixed bug where we cannot move the nodes, removed unused console.logs 2023-06-16 08:37:16 -03:00
Rodrigo Nader
e34587703b Improve chat and build trigger buttons color and shadows
- 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.
2023-06-16 01:43:40 -03:00
Cristhian Zanforlin Lousa
7a6472f103 Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-15 21:37:27 -03:00
Cristhian Zanforlin Lousa
f61d76cfac rollback position of icons 2023-06-15 21:37:24 -03:00
Gabriel Luiz Freitas Almeida
eede3ac0e6 ♻️ refactor(index.ts): remove unused imports from index.ts
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.
2023-06-15 20:48:45 -03:00
Gabriel Luiz Freitas Almeida
11099299d6 Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-15 20:48:36 -03:00
Gabriel Luiz Freitas Almeida
12db6f52fb 🐛 fix(main.py): add a custom 404 handler to return the index.html file when a 404 error occurs
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
2023-06-15 20:48:01 -03:00
Cristhian Zanforlin Lousa
1b0c173f39 Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-15 19:38:16 -03:00
Cristhian Zanforlin Lousa
1af91d7ac0 Changing icons position and layout 2023-06-15 19:38:12 -03:00
Gabriel Luiz Freitas Almeida
2addbf2e0c 🔧 chore(settings.py): change save_api_keys to remove_api_keys to improve semantics
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
2023-06-15 19:29:29 -03:00
Gabriel Luiz Freitas Almeida
e76917b53e 🔧 refactor(__main__.py): refactor update_settings function to accept save_api_keys parameter
 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.
2023-06-15 18:22:12 -03:00
Gabriel Luiz Freitas Almeida
dc8d2362fc Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-15 18:17:18 -03:00
Gabriel Luiz Freitas Almeida
7d61e3dd16 🆕 feat(utils.py): add function to remove API keys from flow data
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.
2023-06-15 18:16:23 -03:00
Gabriel Luiz Freitas Almeida
da24690bf7 🔒 chore(flows.py): add support for removing API keys from flow data if save_api_keys setting is False
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.
2023-06-15 18:16:02 -03:00
Gabriel Luiz Freitas Almeida
99ce643010 🐛 fix(llms.py): add condition to show password field for 'tokens' field name
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.
2023-06-15 18:14:48 -03:00
Gabriel Luiz Freitas Almeida
9909416694 📝 docs(constants.tsx): add documentation for TWEAKS constant
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.
2023-06-15 18:14:23 -03:00
anovazzi1
3d2632aa5f refactor(PageComponent): refactor setTabsState calls to use tabId instead of flow.id to improve semantics and avoid bugs 2023-06-15 18:12:55 -03:00
anovazzi1
bb3fde016d Merge branch 'db' of personal:logspace-ai/langflow into db 2023-06-15 18:03:46 -03:00
anovazzi1
8d6149a124 refactor(PageComponent): add support for setting tabsState.isPending to true when nodes or edges change to indicate that the flow is being edited
feat(PageComponent): import NodeChange from reactflow and add onNodesChangeMod function to handle nodes change and set tabsState.isPending to true
2023-06-15 18:03:28 -03:00
Rodrigo Nader
4f3ea874a5 Refactor build trigger in Chat Component
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.
2023-06-15 17:50:48 -03:00
anovazzi1
64b0ffcde5 feat(frontend): add flow name and description editing functionality to FlowSettingsModal component
fix(frontend): fix saveFlow function call to save edited flow name and description instead of the original flow object
2023-06-15 17:47:24 -03:00
anovazzi1
e22062bba5 feat(PageComponent): add useEffect hook to save flow when component unmounts if flow is pending
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.
2023-06-15 17:12:33 -03:00
anovazzi1
af5f42bf2e Merge branch 'db' of personal:logspace-ai/langflow into db 2023-06-15 16:59:28 -03:00
anovazzi1
c94ae3b6bc feat(tabsContext.tsx): add saveFlow function to save flow changes to database and update state
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
2023-06-15 16:59:17 -03:00
Gabriel Luiz Freitas Almeida
549a544939 feat(ApiModal): add onValueChange prop to Tabs component to update activeTab state
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
2023-06-15 16:49:14 -03:00
Lucas Oliveira
9b3e835a5b Merge branch 'db' of github.com:logspace-ai/langflow into db 2023-06-15 16:12:53 -03:00
Lucas Oliveira
10fdae4c89 changed buttin colors and modal background 2023-06-15 16:12:51 -03:00
anovazzi1
3653f5eefc feat(chatModal): add getWebSocketUrl function to generate WebSocket URL based on chatId and environment
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.
2023-06-15 15:53:56 -03:00
anovazzi1
9c9838927a Merge branch 'db' of personal:logspace-ai/langflow into db 2023-06-15 15:46:59 -03:00
anovazzi1
a62d50a011 feat: Add error message for invalid nodes in BuildTrigger 2023-06-15 15:46:53 -03:00
Lucas Oliveira
f4dcc5da5c Merge branch 'db' of github.com:logspace-ai/langflow into db 2023-06-15 15:45:08 -03:00
Lucas Oliveira
8d72cad17c deleted unused gradients 2023-06-15 15:45:06 -03:00
anovazzi1
2811bc57c4 Merge branch 'db' of personal:logspace-ai/langflow into db 2023-06-15 15:36:22 -03:00
anovazzi1
312766a598 redirect to home page on wrong url 2023-06-15 15:36:10 -03:00
Lucas Oliveira
d72f24a859 Merge branch 'db' of github.com:logspace-ai/langflow into db 2023-06-15 15:33:25 -03:00
Lucas Oliveira
ef00bdea14 Fixed flow name on MenuBar 2023-06-15 15:33:22 -03:00
Gabriel Luiz Freitas Almeida
d3d7392104 🐛 fix(extraSidebarComponent): fix Save button color when isPending is true
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.
2023-06-15 15:33:12 -03:00