Commit graph

2,891 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
c3886ed219 🐛 fix(base.py): change wrong_variables from a set to a list to preserve order and improve error message generation
🔀 refactor(base.py): refactor check_input_variables function to simplify logic and improve readability
The wrong_variables variable is now a list instead of a set to preserve the order of the variables. This change improves the error message generation by ensuring that the variables are displayed in the same order as they appear in the input. The check_input_variables function has been refactored to simplify the logic and improve readability. The code now handles invalid characters and wrong variables separately, making it easier to understand and maintain.
2023-07-06 15:33:54 -03:00
Gabriel Luiz Freitas Almeida
56b23c4a1d 🔧 chore(types.py): add missing return statement in _built_object_repr method of PromptVertex
📝 docs(types.py): improve readability and add clarity to the _built_object_repr method of PromptVertex
The _built_object_repr method of PromptVertex was missing a return statement when the condition in the if statement was not met. This commit adds the missing return statement to ensure the method always returns a value. Additionally, the commit improves the documentation of the method to provide better readability and clarity.
2023-07-06 15:33:53 -03:00
Gabriel Luiz Freitas Almeida
049a41d25e 🔥 refactor(GenericNode/index.tsx): remove unnecessary console.log statement
🔥 refactor(buildTrigger/index.tsx): remove unnecessary console.log statement
The console.log statements were removed as they were no longer needed and were cluttering the code.
2023-07-06 15:33:52 -03:00
Lucas Oliveira
be26ed9979 🔥 refactor(textAreaModal/index.tsx): remove unused imports and code, simplify component structure for better readability and maintainability 2023-07-06 15:32:39 -03:00
Lucas Oliveira
5dc73b41b6 🐛 fix(genericModal/index.tsx): move setValue(inputValue) before the switch statement to ensure proper value assignment 2023-07-06 15:28:54 -03:00
Lucas Oliveira
798be36cd8 🐛 fix(genericModal/index.tsx): change validatePrompt function call to setIsEdit to fix incorrect behavior when blurring input field 2023-07-06 15:27:36 -03:00
Lucas Oliveira
5d417fc11d Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-07-06 15:13:05 -03:00
Lucas Oliveira
01ecf37893 🐛 fix(genericModal/index.tsx): remove redundant setValue call to fix a bug where the value was being set twice
🐛 fix(textAreaModal/index.tsx): remove redundant setValue call to fix a bug where the value was being set twice
2023-07-06 15:09:19 -03:00
Gabriel Luiz Freitas Almeida
86de1ac480
Implementing Prompt Modal with Variables (#616) 2023-07-06 10:29:19 -03:00
Gabriel Luiz Freitas Almeida
7951ccfc77 🐛 fix(base.py): fix logic for checking and fixing input variables in check_input_variables function
🔍 refactor(base.py): refactor build_error_message function to improve readability and error message generation

The check_input_variables function now correctly handles empty variables and variables that start with a number. It removes invalid characters from the variables and adds them to the wrong_variables set. The build_error_message function has been refactored to generate a more informative error message, including details about invalid characters, wrong variables, empty variables, and duplicate variables. This improves the clarity of error messages when validating input variables.
2023-07-06 10:27:26 -03:00
Lucas Oliveira
d6ec2a4713 🔧 fix(chatMessage/index.tsx): change margin-bottom class from "my-3" to "mb-3" and add margin-top class "mt-1" to improve spacing and alignment of chat message component 2023-07-06 01:34:37 -03:00
Lucas Oliveira
4f4e77838f 🐛 fix(accordion.tsx): remove unnecessary hover effect on AccordionTrigger to improve styling
🐛 fix(chatMessage/index.tsx): refactor chat message rendering to improve readability and remove unnecessary code
2023-07-06 01:32:36 -03:00
Lucas Oliveira
26ec9c5d85 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-07-06 00:29:37 -03:00
Lucas Oliveira
0bb664f3ad 🐛 fix(chatMessage): fix styling issue in ChatMessage component to ensure proper alignment and text wrapping
🐛 fix(chatMessage): add max height and overflow to AccordionContent in ChatMessage component to prevent content overflow
🐛 fix(formModal): adjust width of left panel in FormModal component to improve layout
🐛 fix(formModal): fix flexbox alignment issue in right panel of FormModal component
2023-07-06 00:29:05 -03:00
Gabriel Luiz Freitas Almeida
a8900c429d 🔧 chore(base.py): improve the representation of the built object in the Vertex class
The representation of the built object in the Vertex class has been improved to provide more meaningful information. Instead of returning the actual object representation, it now returns "Built successfully" if the object has been built, or "Not built yet" if the object has not been built yet. This change enhances the clarity and readability of the code.
2023-07-05 20:35:39 -03:00
Lucas Oliveira
ed17a621af Changed chat history to contain all keys unformatted, added accordion with all keys 2023-07-05 20:25:49 -03:00
Gabriel Luiz Freitas Almeida
f84cd4026a 🐛 fix(validate.py): set the value of the template field to an empty string
The value of the template field is now set to an empty string to ensure consistency and avoid potential issues with undefined values.
2023-07-05 20:09:11 -03:00
Gabriel Luiz Freitas Almeida
605f7cecb2 🐛 fix(chat.py): handle case when artifacts is empty to prevent potential error
The code now handles the case when the `artifacts` variable is empty by setting `input_keys_response` to an empty dictionary. This prevents potential errors that could occur when trying to build the `input_keys_response` object.
2023-07-05 20:06:27 -03:00
Lucas Oliveira
100419833f 🐛 fix(chatTrigger): update className condition to disable chat trigger button when isBuilt is false or canOpen is false 2023-07-05 19:40:52 -03:00
Lucas Oliveira
9f24f7830c 🐛 fix(codeAreaComponent): adjust classNames to fix styling issues and improve readability
🐛 fix(promptComponent): adjust classNames to fix styling issues and improve readability
🐛 fix(textAreaComponent): adjust classNames to fix styling issues and improve readability
2023-07-05 19:30:48 -03:00
Gabriel Luiz Freitas Almeida
1dcb71b952 🐛 fix(base.py): handle case when base_type is None to avoid ValueError
The code now checks if the `base_type` attribute is None before attempting to instantiate a class. If `base_type` is None, a ValueError is raised with a descriptive error message. This fix prevents potential errors when the `base_type` is not found for a given node.
2023-07-05 17:21:03 -03:00
Cristhian Zanforlin Lousa
6be38af44e merge fix 2023-07-05 16:48:44 -03:00
Lucas Oliveira
87061316b3 formatted code 2023-07-05 16:36:28 -03:00
Lucas Oliveira
e2a066d7f2 Added checks to see if the chat can open 2023-07-05 16:30:46 -03:00
Gabriel Luiz Freitas Almeida
8d77e51037 🔧 chore(pre-commit): change file mode from 100644 to 100755 for better execution permissions
The file mode of the pre-commit hook has been changed from 100644 to 100755. This change ensures that the pre-commit hook has the necessary execution permissions, allowing it to be executed properly before each commit.
2023-07-05 09:49:18 -03:00
Gabriel Luiz Freitas Almeida
a69225bb07 🔧 chore(loading.py): remove unused import statement
🐛 fix(loading.py): remove unnecessary None default value for file_filter parameter
The unused import statement from langchain.prompts.base has been removed to improve code cleanliness. The None default value for the file_filter parameter in the instantiate_documentloader function has been removed as it is unnecessary and can be safely assumed that the parameter will always be provided.
2023-07-05 09:46:27 -03:00
Gabriel Luiz Freitas Almeida
5879ad99f2 🔥 refactor(main.py): remove unused /dynamic_node endpoint and template_node variable
💡 chore(main.py): clean up code by removing an unused endpoint and a template_node variable that is no longer needed
The /dynamic_node endpoint and the template_node variable are no longer used in the application and can be safely removed. This improves code cleanliness and reduces unnecessary complexity.
2023-07-05 09:41:40 -03:00
Gabriel Luiz Freitas Almeida
3059e8c670 🐛 fix(base.py): fix add_edge method to prevent adding duplicate edges
🐛 fix(base.py): fix __eq__ method in Edge class to correctly compare objects
The add_edge method in the Vertex class has been modified to prevent adding duplicate edges. Now, before adding an edge, it checks if the edge already exists in the edges list to avoid duplicates.

The __eq__ method in the Edge class has been fixed to correctly compare objects. It now compares the string representation of the objects to determine equality, ensuring that the comparison is accurate.
2023-07-05 09:37:25 -03:00
Cristhian Zanforlin Lousa
864fb2f8ef Merge branch 'form_io' of https://github.com/logspace-ai/langflow into form_io 2023-07-05 06:52:07 -03:00
Cristhian Zanforlin Lousa
b8e76b0be4 🐛 fix(parameterComponent): remove unnecessary line break to improve code readability
🐛 fix(utils.ts): set 'type' property to an empty string instead of undefined to avoid potential issues
2023-07-05 06:52:01 -03:00
Gabriel Luiz Freitas Almeida
6d9bcd5e65 🔧 chore(Makefile): make pre-commit hook executable
The pre-commit hook in the .githooks directory was not executable, causing it to not be triggered. This commit makes the pre-commit hook executable by adding the `chmod +x` command to set the executable permission on the pre-commit hook file.
2023-07-05 00:03:32 -03:00
Gabriel Luiz Freitas Almeida
10bbb8e901 style: improve readability 2023-07-05 00:01:06 -03:00
Gabriel Luiz Freitas Almeida
834429cd37 fix: add verification for formKeysData 2023-07-04 23:58:54 -03:00
Gabriel Luiz Freitas Almeida
5445adbbce 🐛 fix(validate.py): set new field value with the old value if variable already exists in the template
The code now checks if the variable already exists in the template and if so, sets the new field value with the old value. This ensures that the existing value is preserved when adding new variables to the template.
2023-07-04 23:32:25 -03:00
Gabriel Luiz Freitas Almeida
244aeae916 🔧 chore(validate.py): add multiline option to input_variables field in add_new_variables_to_template function
The multiline option is added to the input_variables field in the add_new_variables_to_template function. This allows the field to accept multiline input, which can be useful in certain scenarios where multiple lines of text need to be entered.
2023-07-04 23:30:24 -03:00
Gabriel Luiz Freitas Almeida
44011f3dd5 🐛 fix(GenericNode/index.tsx): fix class order in div element to ensure correct styling
 feat(GenericNode/index.tsx): improve readability and maintainability by extracting repeated class names into variables
The class order in the div element has been fixed to ensure the correct styling is applied. Repeated class names have been extracted into variables to improve readability and maintainability of the code.
2023-07-04 23:30:23 -03:00
Cristhian Zanforlin Lousa
3f0cc57cd5 🐛 fix(parameterComponent): fix styling issue in tooltip and icon rendering in ParameterComponent 2023-07-04 19:24:37 -03:00
Cristhian Zanforlin Lousa
80efed1d91 adjust edge tooltips 2023-07-04 19:11:15 -03:00
Cristhian Zanforlin Lousa
4f33f02d4f 🐛 fix(parameterComponent): fix syntax error in refHtml.current assignment
🐛 fix(parameterComponent): fix classNames usage in span element
🐛 fix(parameterComponent): remove unnecessary line break element
🐛 fix(parameterComponent): fix className usage in span element
🐛 fix(ShadTooltipComponent): add className prop to TooltipContent component
🐛 fix(utils): fix syntax error in groupByFamily function
 feat(parameterComponent): add support for grouping and displaying multiple types in parameterComponent
 feat(utils): add support for grouping and filtering data in groupByFamily function
2023-07-04 19:08:19 -03:00
Gabriel Luiz Freitas Almeida
8a4f1406de 🐛 fix(validate.py): fix input_types in add_new_variables_to_template function to use correct input types
The input_types in the add_new_variables_to_template function were incorrect. They were set to ["BaseLoader", "BaseOutputParser"] instead of ["Document", "BaseOutputParser"]. This fix ensures that the correct input types are used for the template field.
2023-07-04 09:49:00 -03:00
Gabriel Luiz Freitas Almeida
4ca432c4c0 📦 chore(pyproject.toml): update langchain-serve version to >0.0.49
The langchain-serve package version has been updated to >0.0.49. This change is made to ensure compatibility with the latest version of the package and to take advantage of any bug fixes or new features introduced in the updated version.
2023-07-04 07:28:05 -03:00
Gabriel Luiz Freitas Almeida
1947cf9481 run poetry.lock 2023-07-04 07:20:55 -03:00
Gabriel Luiz Freitas Almeida
3f063f099d 🔺 chore(pyproject.toml): update langchain-serve version to >0.0.50
The langchain-serve package has been updated to version >0.0.50. This update may include bug fixes, new features, or other improvements.
2023-07-03 23:28:07 -03:00
Gabriel Luiz Freitas Almeida
9e1bb15003 🐛 fix(main.py): fix formatting of multiline string in my_user_python_function value
🔀 chore(main.py): add trailing commas to dictionary entries for improved readability
The multiline string in the value of the `my_user_python_function` key was not properly formatted. The double quotes were changed to triple quotes to match the Python docstring convention. Trailing commas were added to the dictionary entries for improved readability and maintainability.
2023-07-03 23:27:59 -03:00
Gabriel Luiz Freitas Almeida
3c7ecd15f7 🐛 fix(validate.py): check if variable is already in the list before appending and remove variable from custom_fields and template when not in input_variables
The code now checks if the variable is already in the list before appending it to the custom_fields. Additionally, when removing old variables from the template, the code now also removes the variable from the custom_fields associated with the given name. This ensures that the custom_fields and template stay in sync with the input_variables.
2023-07-03 23:27:49 -03:00
Gabriel Luiz Freitas Almeida
ac4b322c88 🔨 refactor(parameterComponent): improve code formatting and indentation for better readability
The unused import of the lodash library has been removed to clean up the code and reduce unnecessary dependencies. The code formatting and indentation have also been improved to enhance readability and maintain consistency throughout the file.
🔥 refactor(parameterComponent): remove unused import of lodash library
2023-07-03 23:27:27 -03:00
Gabriel Luiz Freitas Almeida
77a1a9c065 added field_name attribute 2023-07-03 23:12:56 -03:00
Gabriel Luiz Freitas Almeida
00f4726f38 🔧 chore(EditNodeModal): reorder CSS classes in DialogContent and TableCell components for consistency
🔧 chore(EditNodeModal): add field_name prop to PromptAreaComponent for better clarity and maintainability

The CSS classes in the DialogContent and TableCell components have been reordered to follow a consistent pattern of ordering. This improves readability and maintainability of the code.

Additionally, a new prop `field_name` has been added to the PromptAreaComponent to provide better clarity and maintainability when working with the component.
2023-07-03 23:12:30 -03:00
Gabriel Luiz Freitas Almeida
67ffdcd0c7 🔧 chore(API/index.ts): add name parameter to postValidatePrompt function for improved code readability
The postValidatePrompt function now accepts a name parameter, which represents the name of the field to check. This change improves the code readability by explicitly specifying the name of the field being validated.
2023-07-03 23:12:18 -03:00
Gabriel Luiz Freitas Almeida
2344c575cf 🔧 fix(promptComponent): fix linting issues and add missing field_name prop
🚀 feat(promptComponent): improve prompt functionality by adding missing field_name prop
Fixed some linting issues in the PromptAreaComponent and added the missing field_name prop to improve code quality and maintainability. The field_name prop was missing, which caused an error in the postValidatePrompt function. This commit also improves the prompt functionality by ensuring that the reactFlowInstance is updated and the nodes are re-rendered when the value changes.
2023-07-03 23:11:37 -03:00