Commit graph

11,619 commits

Author SHA1 Message Date
Igor Carvalho
215e04078b feat: add extra side bar constants classes 2023-07-04 18:24:55 -03:00
anovazzi1
3fd22bbbf3
Add style constants to index.css file (#601)
Improves code verbosity and organization of Tailwind classes.
2023-07-04 17:55:10 -03:00
Igor Carvalho
bfd830f1e4 feat: Change extra side bar buttons classes to tailwind constants 2023-07-04 17:45:47 -03:00
Igor Carvalho
a35529d59f feat: remove class button-div-style from constants.tsx file 2023-07-04 17:08:13 -03:00
gustavoschaedler
13bb0280f5 [extract_info_from_class.py] Remove unnecessary code
This commit removes the file `extract_info_from_class.py` which contained unnecessary code.

[v1/endpoints.py] Fix error handling in custom_component endpoint

This commit fixes the error handling in the `custom_component` endpoint in `endpoints.py`. If the class template extracted from the code is not valid, an error message is printed.

[importing/utils.py] Comment out unused code

This commit comments out unused code in `get_function_custom` function in `utils.py` file.

[initialize/loading.py] Comment out unused code

This commit comments out unused code in the `instantiate_tool` function in `loading.py` file.

[interface/tools/custom.py] Refactor code and add properties

This commit refactors the code in `CustomComponent` class in `custom.py` file. It adds properties for `data`, `is_valid`, and `args_and_return_type`.

[interface/types.py] Add base classes to custom component template

This commit adds base classes to the custom component template in the `build_langchain_template_custom_component` function in `types.py` file.

[utils/constants.py] Remove unnecessary import

This commit removes an unnecessary import in `DEFAULT_CUSTOM_COMPONENT_CODE` constant in `constants.py` file.
2023-07-04 21:00:02 +01:00
anovazzi1
0d6293de17 fix(codeAreaModal): move postCustomComponent call outside of the else block to ensure it is always executed 2023-07-04 15:51:32 -03:00
anovazzi1
da4be03451 using post 2023-07-04 15:46:38 -03:00
anovazzi1
cbcb8bf36d feat(utils.ts): add custom icon for Edit functionality in nodeIconsLucide to improve user experience 2023-07-04 15:32:18 -03:00
anovazzi1
57a12d2084 fix(codeAreaModal): comment out unused code block to improve code readability
fix(codeAreaModal): fix condition in TabsTrigger component to correctly disable the error tab when error detail is undefined
2023-07-04 15:22:38 -03:00
anovazzi1
18a2459131 fix(codeAreaModal): initialize error state with null to avoid undefined error
fix(codeAreaModal): disable second tab trigger if error detail is null to prevent user from switching to it
2023-07-04 15:13:57 -03:00
anovazzi1
562efe2867 new attribute dynamic added 2023-07-04 14:55:17 -03:00
Gabriel Luiz Freitas Almeida
9b185fada5 🐛 fix(GenericNode/index.tsx): fix incorrect class names for validation status indicators
The class names for the validation status indicators were incorrect, causing the wrong styles to be applied. The class names have been fixed to correctly display the validation status indicators based on the validation status and whether the node is building.
2023-07-04 10:41:14 -03:00
Gabriel Luiz Freitas Almeida
a3792577a8 🔄 refactor(vertex/base.py): rename Node class to Vertex class for better clarity and consistency
🔄 refactor(template/frontend_node/documentloaders.py): rename web_path variable to file_path for better clarity and consistency in the GutenbergLoader class
The Node class in the vertex/base.py file has been renamed to Vertex class to improve clarity and consistency in the naming conventions used throughout the codebase. In the template/frontend_node/documentloaders.py file, the web_path variable has been renamed to file_path in the GutenbergLoader class to provide better clarity and consistency in the naming conventions used within the class.
2023-07-04 10:08:41 -03:00
Gabriel Luiz Freitas Almeida
0cf94f37f6 🔒 chore(vectorstores.py): add password field to extra_fields in VectorStoreFrontendNode class
The password field is added to the extra_fields list in the VectorStoreFrontendNode class. This allows for the creation of a password input field in the frontend UI for this specific class.
2023-07-04 09:58:11 -03:00
Gabriel Luiz Freitas Almeida
7d098ab927 🔒 chore(vectorstores.py): add password field to extra_field2 in VectorStoreFrontendNode class
The password field is added to the extra_field2 in the VectorStoreFrontendNode class. This allows the field to be displayed as a password input in the frontend, enhancing security by hiding the input characters.
2023-07-04 09:56:52 -03:00
Gabriel Luiz Freitas Almeida
608145af9e 🔧 chore(documentloaders.py): moved GutenbergLoader to be used with web_path 2023-07-04 09:51:48 -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
Gabriel Luiz Freitas Almeida
6431b50fa6 🐛 fix(base.py): change custom_fields default value from an empty list to a defaultdict to prevent potential errors
The custom_fields attribute in the FrontendNode class now has a default value of defaultdict(list) instead of an empty list. This change ensures that custom_fields is always a defaultdict, which prevents potential errors when accessing or modifying the custom_fields attribute.
2023-07-03 23:11:08 -03:00
Gabriel Luiz Freitas Almeida
88dbff7bf5 🚀 feat(base.py): add 'name' field to ValidatePromptRequest model for improved data validation
The 'name' field is added to the ValidatePromptRequest model to enhance data validation. This field will allow for more specific identification and validation of prompt names in the API.
2023-07-03 23:10:56 -03:00
Gabriel Luiz Freitas Almeida
d5c7fb9dc5 🐛 fix(validate.py): rename parameter 'prompt' to 'prompt_request' in post_validate_prompt function for clarity
 feat(validate.py): refactor post_validate_prompt function to improve code readability and maintainability
The parameter 'prompt' in the 'post_validate_prompt' function has been renamed to 'prompt_request' to improve clarity and avoid confusion with the 'prompt' variable used within the function. The function has also been refactored to improve code readability and maintainability by extracting logic into separate helper functions. The helper functions 'get_old_custom_fields', 'add_new_variables_to_template', 'remove_old_variables_from_template', and 'update_input_variables_field' have been added to handle specific tasks within the 'post_validate_prompt' function. This refactoring improves the overall structure and organization of the code.
2023-07-03 23:10:41 -03:00
Lucas Oliveira
369a32d53a 🎨 style(extraSidebarComponent): add bottom padding to the overflow container to improve UI spacing 2023-07-03 22:25:02 -03:00
Lucas Oliveira
3c29410488 Changed dark mode colors 2023-07-03 22:22:48 -03:00
Lucas Oliveira
54474889e1 🐛 fix(GenericNode/index.tsx): fix title prop in ParameterComponent to handle cases where data.node.output_types is an empty array
🔧 chore(GenericNode/index.tsx): add console.log for debugging purposes
2023-07-03 22:20:58 -03:00
Lucas Oliveira
d4b0ce9851 🐛 fix(codeAreaComponent): fix type name in function parameter to match imported type
🐛 fix(textAreaComponent): fix class name in className to match CSS class name convention
2023-07-03 22:16:17 -03:00
Lucas Oliveira
a9cd09dc5e Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-07-03 22:09:53 -03:00
Lucas Oliveira
dde42eec0f 🎨 style(chatTrigger): update chat trigger button styles to include disabled state
🔧 chore(index.css): add CSS variable for disabled chat trigger color
🔧 chore(tailwind.config.js): add CSS variable for disabled chat trigger color
2023-07-03 22:09:43 -03:00
Gabriel Luiz Freitas Almeida
19d161aec3 📝 docs(config.yaml): add documentation links for new modules and update existing links
🔖 chore(config.yaml): update documentation links for vectorstores and output parsers
Added documentation links for the following new modules:
- MongoDBChatMessageHistory
- ChatMessagePromptTemplate
- HumanMessagePromptTemplate
- SystemMessagePromptTemplate
- ChatPromptTemplate

Updated documentation links for the following existing modules:
- MongoDBAtlasVectorSearch

Also, added documentation links for the following output parsers:
- StructuredOutputParser
- ResponseSchema

The documentation links were added or updated to provide easy access to relevant documentation for each module and output parser.
2023-07-03 22:09:02 -03:00
Gabriel Luiz Freitas Almeida
18a04ad170 🔀 refactor(constants.py): refactor VERTEX_TYPE_MAP to use explicit import paths for better readability and maintainability
The VERTEX_TYPE_MAP dictionary in constants.py has been refactored to use explicit import paths for each vertex type. This improves the readability and maintainability of the code by making it clear where each vertex type is coming from.
2023-07-03 21:56:49 -03:00
Gabriel Luiz Freitas Almeida
3bab730e65 🔀 refactor(base.py): import field_formatters module instead of importing specific module
🔀 refactor(base.py): move FieldFormatters class to the top of the file for better organization
The import statement in the base.py file has been updated to import the field_formatters module instead of importing specific modules. This change improves maintainability and readability by reducing the number of import statements and consolidating them into a single import. Additionally, the FieldFormatters class has been moved to the top of the file for better organization and readability.
2023-07-03 21:56:28 -03:00
Lucas Oliveira
d0217f0c26 Merge branch 'dev' into form_io, bugs on backend 2023-07-03 21:53:56 -03:00
Cristhian Zanforlin Lousa
cd1cb854e7 Merge branch 'form_io' of https://github.com/logspace-ai/langflow into form_io 2023-07-03 18:53:08 -03:00
Cristhian Zanforlin Lousa
f8d9f47b7e 🐛 fix(parameterComponent): fix classNames order in ParameterComponent to ensure correct styling
🐛 fix(utils): fix logic in isValidConnection to correctly check for valid connections
 feat(parameterComponent): add support for left alignment of parameter title in ParameterComponent
 feat(utils): add support for filtering grouped data by parentOutput in groupByFamily function
2023-07-03 18:53:02 -03:00
anovazzi1
d91451cbfa
Implementing @layer components for CSS (#594)
This pull request introduces a new feature that enhances our CSS
architecture by adding support for @layer components. With this feature,
we can now organize and manage our CSS more efficiently, making it
easier to work with and maintain.
2023-07-03 17:59:34 -03:00
Gabriel Luiz Freitas Almeida
f79ee7092a 🐛 fix(validate.py): update input_types in template_field to ["Document", "BaseOutputParser"] for better accuracy
🐛 fix(base.py): remove "object" from CLASSES_TO_REMOVE list to prevent unnecessary removal
In validate.py, the input_types in the template_field for the "prompt" variable is updated to ["Document", "BaseOutputParser"] to accurately reflect the expected input types.

In base.py, the "object" class is removed from the CLASSES_TO_REMOVE list to prevent unnecessary removal of the "object" class from the FrontendNode class inheritance.
2023-07-03 17:35:44 -03:00
Cristhian Zanforlin Lousa
77c423fd0c 🔧 fix(ApiModal): update CSS classes for responsive layout and code readability 2023-07-03 17:08:58 -03:00
Gabriel Luiz Freitas Almeida
0cfcfcb912 🐛 fix(types.py): remove extra blank line to improve code readability
🐛 fix(GenericNode/index.tsx): remove unused imports and unused variable to improve code cleanliness
The extra blank line in the `types.py` file has been removed to improve the readability of the code. In the `GenericNode/index.tsx` file, unused imports and an unused variable have been removed to clean up the code and improve maintainability.
2023-07-03 16:38:06 -03:00
Gabriel Luiz Freitas Almeida
db17aceb3b 🔧 fix(base.py): add output_types field to FrontendNode class to support specifying output types
🔧 fix(documentloaders.py): add_extra_base_classes method to set base_classes and output_types for DocumentLoaderFrontNode
🔧 fix(textsplitters.py): add_extra_base_classes method to set base_classes and output_types for TextSplittersFrontendNode
🔧 fix(vectorstores.py): change field_type to "Document" for documents field in VectorStoreFrontendNode
🔧 fix(index.ts): add output_types field to APIClassType interface
The changes were made to add support for specifying output types in the FrontendNode class and its subclasses. This allows for more flexibility in defining the behavior and capabilities of the frontend nodes in the application.
2023-07-03 16:37:37 -03:00
Cristhian Zanforlin Lousa
8e6c537d76 🐛 fix(ApiModal/index.tsx): fix indentation and spacing issues for better code readability
 feat(ApiModal/index.tsx): improve UI by adjusting the layout and styling of the modal components
2023-07-03 16:21:20 -03:00
Cristhian Zanforlin Lousa
c66939f7c2 🔧 chore(frontend): remove unused imports and constants from codeAreaComponent, dropdownComponent, floatComponent, inputComponent, inputFileComponent, inputListComponent, intComponent, promptComponent, and textAreaComponent
🔧 fix(index.css): add new styles for input components to improve consistency and usability
🔧 fix(ApiModal/index.tsx): fix potential null reference error when pushing tweaks to the current tweak ref
🔧 fix(chatInput/index.tsx): remove unused constant import and update input style class name
🔧 fix(genericModal/index.tsx): update class name for textarea to match new primary form style
🔧 fix(textAreaModal/index.tsx): update class name for textarea to match new primary form style
🔧 fix(extraSidebarComponent/index.tsx): remove unused constant imports and update input search class name
2023-07-03 16:17:57 -03:00
Lucas Oliveira
d371a08d9e Chat disabled when not built 2023-07-03 14:52:14 -03:00