Commit graph

11,619 commits

Author SHA1 Message Date
Lucas Oliveira
78a069d7ad Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-30 12:54:28 -03:00
Lucas Oliveira
61e87a6d54 🐛 fix(switch.tsx): add aria-disabled attribute to the Switch component to improve accessibility
🎨 style(switch.tsx): update class names in the Switch component to improve readability and maintainability
2023-06-30 12:54:07 -03:00
gustavoschaedler
6416c43ff2 Merge remote-tracking branch 'origin/form_io' into python_custom_node_component 2023-06-30 16:44:11 +01:00
Gabriel Luiz Freitas Almeida
356c76b1b2 feat(constants.tsx): update DESCRIPTIONS, ADJECTIVES, and NOUNS arrays with new values to enhance variety and creativity in generated text
The DESCRIPTIONS array has been updated with additional phrases to provide a wider range of options for generating text. The ADJECTIVES array has been expanded with more descriptive words to add more color and personality to the generated text. The NOUNS array has been enriched with new names to increase the diversity of possible flow names. These updates aim to enhance the quality and creativity of the generated text by providing a greater variety of options.
2023-06-30 12:01:01 -03:00
Lucas Oliveira
562bbe99ee Undo Snapshot when importing by drop 2023-06-30 11:45:36 -03:00
Lucas Oliveira
374f462f17 🔨 refactor(formModal/index.tsx): remove unused MessageSquarePlus component and adjust styling for chat input section 2023-06-30 11:35:52 -03:00
Lucas Oliveira
a13e60ed57 Fixed icon size at node changing with title size 2023-06-30 11:33:07 -03:00
Lucas Oliveira
7fddffc12e 🎨 style(formModal/index.tsx): adjust size and spacing of icons and text in FormModal component for better visual consistency
🐛 fix(formModal/index.tsx): add unique key prop to dynamically rendered elements in FormModal component to remove console warning
2023-06-30 11:28:48 -03:00
Lucas Oliveira
3937b30e16 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-30 11:25:05 -03:00
Lucas Oliveira
1aa906dbb6 Added logic to upload flow on drop 2023-06-30 11:25:00 -03:00
Gabriel Luiz Freitas Almeida
0eead8f3f7 🐛 fix(loading.py): fix condition to check for "handle_keys" in format_kwargs instead of params
The condition to check for the presence of "handle_keys" has been fixed to correctly check for its existence in the format_kwargs dictionary instead of the params dictionary. This ensures that the "handle_keys" list is properly populated when necessary.
2023-06-30 11:23:19 -03:00
Lucas Oliveira
052155bc6a Edited dragOver drop effect on dropping file, printed file dropped over the pane 2023-06-30 11:19:50 -03:00
Gabriel Luiz Freitas Almeida
270d5fb106 🐛 fix(loading.py): add missing condition to check if variable is an instance of BaseOutputParser and has "get_format_instructions" attribute
The code was missing a condition to check if the variable is an instance of BaseOutputParser and has the "get_format_instructions" attribute. This condition is necessary to properly handle the variable and avoid potential errors.
2023-06-30 11:17:32 -03:00
Gabriel Luiz Freitas Almeida
156b3cc5c2 🔧 chore(config.yaml): comment out ChatVertexAI integration due to a bug causing AttributeError
The ChatVertexAI integration is temporarily commented out due to a bug that causes an AttributeError. This bug needs to be resolved before the integration can be activated again.
2023-06-30 11:10:52 -03:00
Gabriel Luiz Freitas Almeida
06aea7da88 🔀 chore(custom_lists.py): reformat import statements for better readability and maintainability
🔀 chore(custom_lists.py): add ChatVertexAI to the import statements for better modularity and extensibility
🔀 chore(custom_lists.py): add ChatVertexAI to the llm_type_to_cls_dict for better compatibility and flexibility
🔀 chore(llms.py): change required field for credentials to be optional for better user experience
🔀 chore(llms.py): add advanced and show fields for specific fields related to VertexAI for better configurability

The import statements in `custom_lists.py` have been reformatted to improve readability and maintainability. The `ChatVertexAI` class has been added to the import statements to enhance modularity and extensibility.

The `ChatVertexAI` class has been added to the `llm_type_to_cls_dict` dictionary in `custom_lists.py` to improve compatibility and flexibility.

In `llms.py`, the `required` field for the `credentials` field has been changed to be optional for a better user experience.

The `advanced` and `show` fields have been added to specific fields related to VertexAI in `llms.py` to provide better configurability.
2023-06-30 11:09:13 -03:00
Cristhian Zanforlin Lousa
7be93653c3 🔧 fix(inputListComponent): remove unnecessary padding from input list component to improve layout
🔧 fix(tabsContext): add optional fileName parameter to downloadFlow function to allow customizing the downloaded file name
🔧 fix(exportModal): add optional fileName parameter to downloadFlow function calls to allow customizing the downloaded file name
🔧 fix(tabsContext): update downloadFlow function signature to include optional fileName parameter
2023-06-30 10:52:23 -03:00
Lucas Oliveira
fe16467914 🐛 fix(toggleShadComponent): remove unused useEffect hook to improve code readability and maintainability
 feat(toggleShadComponent): add disabled prop to Switch component to disable interaction when disabled is true

🐛 fix(formModal): remove unused imports to improve code cleanliness
 feat(formModal): add MessageSquarePlus icon to represent chat input
 feat(formModal): add multiple collapsible accordions for input variables
🐛 fix(formModal): disable Toggle component when handle key is present in formKeysData
2023-06-30 10:48:51 -03:00
Lucas Oliveira
6e5222306a Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-30 10:31:39 -03:00
Lucas Oliveira
5520ecea7a 🐛 fix(formModal/index.tsx): stop propagation of click event at the toggle component 2023-06-30 10:31:03 -03:00
Gabriel Luiz Freitas Almeida
683c69340b
Fix: Required input llm for module LLMChain not found (#566) 2023-06-30 10:10:07 -03:00
Gabriel Luiz Freitas Almeida
e01fe86caa 🐛 fix(base.py): simplify the logic to find the matched_type in the Edge class
The logic to find the matched_type in the Edge class has been simplified by removing unnecessary nested loops and using a single generator expression. This improves the readability and efficiency of the code.
2023-06-30 10:09:56 -03:00
Gabriel Luiz Freitas Almeida
3bdc35d238 🔧 chore(llm.py): add function to initialize VertexAI credentials
🔧 chore(loading.py): call initialize_vertexai function when node_type is "VertexAI"
The `llm.py` file now includes a new function `initialize_vertexai` that initializes the VertexAI credentials if a `credentials` parameter is provided. This allows for the usage of VertexAI credentials in the application. In `loading.py`, the `initialize_vertexai` function is called when the `node_type` is "VertexAI", ensuring that the VertexAI credentials are properly initialized for that specific node type.
2023-06-30 10:09:29 -03:00
Gabriel Luiz Freitas Almeida
bbf4c38740 🔀 refactor(llms.py): simplify condition for showing fields in the VertexAI class
The condition for showing fields in the VertexAI class has been simplified to exclude specific field names. This improves readability and maintainability of the code.
2023-06-30 09:35:33 -03:00
Gabriel Luiz Freitas Almeida
e8de0c60ef 🔒 chore(pyproject.toml): update python dependency version to >=3.9,<3.11 to ensure compatibility
⬆️ feat(pyproject.toml): add google-cloud-aiplatform dependency to enable integration with Google Cloud AI Platform
The python dependency version has been updated to >=3.9,<3.11 to ensure compatibility with the project. Additionally, the google-cloud-aiplatform dependency has been added to enable integration with Google Cloud AI Platform services.
2023-06-30 09:23:17 -03:00
Gabriel Luiz Freitas Almeida
4d72c92e4c 🔧 chore(llms.py): add extra fields for VertexAI template and modify field type for "credentials"
📝 chore(llms.py): improve field configuration for VertexAI template and modify field type for "credentials"
The `add_extra_fields` method is modified to add an additional field called "credentials" for the VertexAI template. The field is of type "file" and is required. It allows the user to upload a JSON file as credentials. The `format_openai_field` method is also updated to handle the new "credentials" field.
2023-06-30 09:00:18 -03:00
Gabriel Luiz Freitas Almeida
3ae84bea13 🔧 chore(validate.py): add display_name field to TemplateField in post_validate_prompt function
The display_name field is added to the TemplateField object in the post_validate_prompt function. This field allows for a more user-friendly display of the variable name in the UI.
2023-06-30 06:46:00 -03:00
Lucas Oliveira
54b5aa65da 🔨 refactor(formModal/index.tsx): organize imports and format code for better readability
 feat(formModal/index.tsx): add support for dropdown menu component and button component
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
🐛 fix(formModal/index.tsx): fix type error and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for dropdown menu component and button component
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for dropdown menu component and button component
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for dropdown menu component and button component
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting
 feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly
🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code
2023-06-30 00:09:34 -03:00
Lucas Oliveira
91fc931081 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 23:20:24 -03:00
Lucas Oliveira
9acff51555 🔧 chore(codeBlock/index.tsx): adjust className to use relative width instead of fixed width to improve responsiveness 2023-06-29 23:19:44 -03:00
Lucas Oliveira
4875098209 🐛 fix(formModal/index.tsx): fix initial value of chatValue to correctly retrieve value from tabsState
🐛 fix(formModal/index.tsx): fix initial value of chatKey to correctly retrieve key from tabsState
🐛 fix(formModal/index.tsx): fix handleOnCheckedChange to correctly set chatKey and chatValue
🐛 fix(formModal/index.tsx): fix onChange of Textarea to correctly update tabsState input_keys
 feat(formModal/index.tsx): add support for clearing input value when form is submitted
 feat(formModal/index.tsx): add support for clearing input value when form is closed
2023-06-29 23:13:29 -03:00
Gabriel Luiz Freitas Almeida
af84dd2c68 🔀 refactor(process.py): rename build_langchain_object_with_caching to build_sorted_vertices_with_caching for better clarity
🐛 fix(process.py): handle missing inputs in process_graph_cached function
The function `build_langchain_object_with_caching` has been renamed to `build_sorted_vertices_with_caching` to provide a more descriptive name that accurately reflects its purpose. Additionally, the `process_graph_cached` function now handles cases where the `inputs` parameter is missing or empty by populating it with values from the `artifacts` dictionary. This ensures that all required inputs are properly set before running the graph.
2023-06-29 22:49:32 -03:00
Gabriel Luiz Freitas Almeida
e43cbdacb7 feat (process.py): The build_sorted_vertices_with_caching function is added to build the sorted vertices of the langchain object with caching. It also uses the memoize_dict decorator to cache the result. The function first builds the langchain object from the data graph, then iterates over the sorted vertices and updates the artifacts dictionary. This ensures that the artifacts are properly updated during the building process.
Both caching mechanisms improve the performance of building the langchain object and sorted vertices, reducing redundant computations and improving overall efficiency.

The `build_langchain_object_with_caching` function now uses the `memoize_dict` decorator to cache the result of building the langchain object from the data graph. This improves performance by avoiding redundant computations when the same data graph is used multiple times.
2023-06-29 22:48:20 -03:00
Lucas Oliveira
8546843b0d Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 22:33:09 -03:00
Lucas Oliveira
8229bf4b4e 🐛 fix(chatInput): adjust padding-right value to align input field properly
🐛 fix(chatMessage): set max-width to prevent overflow of markdown content
🐛 fix(formModal): remove unnecessary badge for handle keys in accordion item
2023-06-29 22:32:56 -03:00
Gabriel Luiz Freitas Almeida
9a69a71ea1 🐛 fix(chat.py): add exception logging to stream_build function to improve error handling
The `stream_build` function now logs the exception that occurred during the flow building process using the `logger.exception` method. This improves error handling and provides more detailed information about the error in the logs.
2023-06-29 22:07:23 -03:00
Gabriel Luiz Freitas Almeida
766ef28a0c 🔧 refactor(base.py): add source_handle, target_handle, and target_param attributes to Edge class
The Edge class constructor now takes an additional parameter 'edge' which is a dictionary containing additional information about the edge. This information is used to set the source_handle, target_handle, and target_param attributes of the Edge class. This change allows for more flexibility and extensibility when working with edges in the graph.
🔧 refactor(base.py): add edge parameter to Edge class constructor to pass additional edge information
2023-06-29 22:06:57 -03:00
Gabriel Luiz Freitas Almeida
cfcdb67ed9 🚀 feat(base.py): add default values for string and prompt type parameters in _build_params method
The unused imports have been removed to improve code cleanliness. The code in the _build_params method has been simplified by removing unnecessary conditions and loops. Default values are now added for string and prompt type parameters to ensure that they have a value even if not explicitly set.
🔧 fix(base.py): remove unused imports and simplify code in _build_params method
2023-06-29 22:05:22 -03:00
Lucas Oliveira
966444a88b 🐛 fix(formModal/index.tsx): remove unnecessary handle badge from AccordionTrigger and AccordionItem components 2023-06-29 21:33:05 -03:00
Lucas Oliveira
2c4803d28a 🔨 refactor(formModal/index.tsx): remove unused code related to handle_keys in the form modal
🔨 refactor(formModal/index.tsx): remove unused code related to handle_keys in the form modal to improve code readability and maintainability
2023-06-29 21:29:34 -03:00
Lucas Oliveira
afd7641063 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 21:14:47 -03:00
Lucas Oliveira
e4b03d7765 🐛 fix(parameterComponent): import lodash library to use _.cloneDeep function
🐛 fix(chatComponent): import lodash library to use _.cloneDeep function
 feat(chatComponent): add TabsContext to access tabsState and update isBuilt state based on tabsState changes
2023-06-29 21:14:30 -03:00
Gabriel Luiz Freitas Almeida
9e973f0bfc
🔖 chore(pyproject.toml): update package version to 0.2.7 (#573) 2023-06-29 20:44:47 -03:00
Gabriel Luiz Freitas Almeida
e426698c45
Merge branch 'main' into release 2023-06-29 20:44:38 -03:00
Gabriel Luiz Freitas Almeida
606779f216 🔖 chore(pyproject.toml): update package version to 0.2.7
The package version has been updated from 0.2.6 to 0.2.7. This change is made to reflect the latest changes and improvements in the package.
2023-06-29 20:43:52 -03:00
Gabriel Luiz Freitas Almeida
e98e0b22df 🐛 fix(vertex/base.py): add input types from template_dicts to optional_inputs
🐛 fix(interface/initialize/loading.py): handle BaseOutputParser instances in instantiate_prompt
The `optional_inputs` list in the `Vertex` class is now extended with the `input_types` from the `template_dicts` dictionary. This ensures that the `optional_inputs` list contains all the input types that are not required. In the `instantiate_prompt` function, if the `variable` is an instance of `BaseOutputParser` and has a `get_format_instructions` method, the `format_kwargs` dictionary is updated with the result of calling `get_format_instructions()`. This allows handling `BaseOutputParser` instances correctly in the `instantiate_prompt` function.
2023-06-29 20:43:22 -03:00
Gustavo Schaedler
12164ec79a
CSS Color Changes and Dark Mode Implementation - New Style Features (#572)
This pull request introduces significant style changes to the website,
focusing on CSS color modifications and the implementation of a dark
mode feature. These updates enhance the overall visual appeal and
improve user experience in different lighting environments. Below is a
detailed overview of the changes made.

Updated Color Palette: The existing color scheme has been revamped to
create a more visually appealing and cohesive design. This involved
modifying the colors used throughout the website, including background
colors, text colors, and accent colors.

Dark Mode Implementation: A new feature, dark mode, has been added to
provide users with an alternative interface that is easier on the eyes
in low-light environments. The dark mode utilizes a new set of colors
specifically designed for this mode, ensuring optimal readability and
aesthetic appeal.

CSS Classes and Selectors: New CSS classes and selectors have been
introduced to facilitate the implementation of the color changes and
dark mode feature. These classes are applied to specific elements within
the HTML structure, allowing for precise control over the appearance of
different components.
2023-06-30 00:41:27 +01:00
Lucas Oliveira
ffebce974f 🔨 refactor(formModal): remove unused keysValue state variable to improve code cleanliness and readability
🔨 refactor(formModal): update formKeysData type in tabsState to include handle_keys array for better data structure consistency and completeness
2023-06-29 20:34:31 -03:00
Lucas Oliveira
fce7b398f7 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 20:30:44 -03:00
Lucas Oliveira
21174c0e8b Fixed key problem 2023-06-29 20:30:39 -03:00
gustavoschaedler
dd009a2913 feat: Add support for Custom Component in Langflow Interface
This commit adds support for Custom Component in the Langflow interface. It introduces a new class `CustomComponent`, which takes in a `code` as a parameter and validates it. The `CustomComponent` class also provides a method to get the function specified in the code.

The commit also makes some modifications in `initialize/loading.py` file to handle the new `CustomComponent` class. It adds a new helper function `get_function_custom` which creates a function using `validate.create_function` and the `build` function name.
2023-06-30 00:23:50 +01:00