Commit graph

2,091 commits

Author SHA1 Message Date
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
Gabriel Luiz Freitas Almeida
7d897929b3 Merge branch 'db' of https://github.com/logspace-ai/langflow into db 2023-06-15 15:31:43 -03:00
Gabriel Luiz Freitas Almeida
f21bc80359 🔨 refactor(buildTrigger): remove unused state variable 'valid' and simplify streamNodeData function
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.
2023-06-15 15:30:51 -03:00
Lucas Oliveira
6275f904bc Merge branch 'db' of github.com:logspace-ai/langflow into db 2023-06-15 15:24:45 -03:00
Lucas Oliveira
82b5b450bc Changed code modal 2023-06-15 15:24:42 -03:00
Gabriel Luiz Freitas Almeida
cb7c8b45cd 🔨 refactor(API): add type to updateFlowInDatabase function and format code
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.
2023-06-15 15:08:39 -03:00
Gabriel Luiz Freitas Almeida
265646ded3 🐛 fix(chat.py): change the prefix of the error message to 'data' to fix the server response
The error message prefix was changed from 'data' to 'error' to fix the server response.
2023-06-15 15:08:38 -03:00
Gabriel Luiz Freitas Almeida
03076b3577 🔨 refactor(flows.py): change response model of update_flow endpoint to FlowRead
🔨 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.
2023-06-15 15:08:37 -03:00
Gabriel Luiz Freitas Almeida
499d5238e3 🔥 refactor(chatModal): remove unused function getWebSocketUrl
The function getWebSocketUrl was not being used in the code and was therefore removed to improve code readability and maintainability.
2023-06-15 15:08:36 -03:00
Lucas Oliveira
78a0ed60e9 changed button color 2023-06-15 14:54:12 -03:00
Lucas Oliveira
3e4bfc99b8 deleted function and changed button color 2023-06-15 14:52:26 -03:00
Lucas Oliveira
ded204efc9 Merge branch 'db' of github.com:logspace-ai/langflow into db 2023-06-15 14:43:04 -03:00