Commit graph

6,039 commits

Author SHA1 Message Date
Jorge
9784817821 Add CodeQL workflow 2023-06-28 18:42:32 +02:00
gustavoschaedler
cd4c73ac28 Import random module and HTTPStatus from http module in endpoints.py. Add CustomComponentResponseError to the import in schemas.py. Change the status_code in create_upload_file endpoint to use the HTTPStatus.CREATED constant. Change the status_code in custom_component endpoint to use the HTTPStatus.OK constant. Add a new endpoint for custom_component_error that returns a random error response. 2023-06-28 17:37:48 +01:00
Rodrigo Nader
4e9565e468 feat: Update styling for various components
- Updated hover and transition effects for several components
- Removed unnecessary CSS classes and styles
- Adjusted colors and text styles for better visual consistency
2023-06-28 12:54:54 -03:00
Rodrigo Nader
b14d6d4238 Refactor crash error component, header component, and main page component
- Refactored crash error component to update the background color of the reset button.
- Removed commented code in the header component.
- Imported BUTTON_DIV_STYLE constant in the main page component.
2023-06-28 12:51:05 -03:00
Rodrigo Nader
80a73f93fe Merge remote-tracking branch 'origin/dev' into new-style-features 2023-06-28 12:35:23 -03:00
gustavoschaedler
91f8573bed Merge remote-tracking branch 'origin/form_io' into python_custom_node_component 2023-06-28 16:33:54 +01:00
gustavoschaedler
7d483eb7c9 Add ClassCodeExtractor and related functions to extract and handle information from a class. Also add the utility functions is_valid_class_template, get_entrypoint_function_args_and_return_type, find_class_type, and build_langchain_template_custom_component. 2023-06-28 16:32:48 +01:00
Cristhian Zanforlin Lousa
ab0fcc9cb0 🔧 chore(ApiModal): add tweak.current assignment to improve code readability and maintainability 2023-06-28 12:16:27 -03:00
Gabriel Luiz Freitas Almeida
695bc4c9bf 🐛 fix(manager.py): rename variables in ChatManager class to improve clarity and consistency
🐛 fix(utils.py): rename variable in process_graph function to improve clarity and consistency

In the `ChatManager` class, the variable `chat_message` has been renamed to `chat_inputs` to better reflect its purpose of storing the input messages from the chat payload. This improves clarity and consistency within the class.

In the `process_graph` function in `utils.py`, the variable `chat_message` has been renamed to `chat_inputs` to better reflect its purpose of storing the input messages from the chat payload. This improves clarity and consistency within the function.
2023-06-28 12:01:36 -03:00
Lucas Oliveira
5c22062f72 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:52:44 -03:00
Lucas Oliveira
c76b8766c0 🔨 refactor(chatComponent): remove unused import of ChatModal to improve code cleanliness
🔨 refactor(chatComponent): update code to correctly access template value from node data

🔨 refactor(chatInput): update button styling and positioning

🔨 refactor(chatInput): update Lock icon styling and positioning

🔨 refactor(chatInput): update Send icon styling and positioning

🔨 refactor(formModal): update setKeysValue function to correctly update the value at a specific index in the array
2023-06-28 11:51:21 -03:00
Gabriel Luiz Freitas Almeida
5a76d36cd4 🔧 chore(utils.py): refactor build_input_keys_response function to return an empty string for each input key
The build_input_keys_response function has been refactored to return an empty string for each input key in the langchain_object. This change ensures consistency in the response structure and provides a default value for each input key.
2023-06-28 11:44:07 -03:00
Cristhian Zanforlin Lousa
dc4d1ccd65 🐛 fix(ApiModal): remove unnecessary div tag to fix layout issue
🐛 fix(codeAreaModal): fix closePopUp function call placement to ensure proper functionality
🐛 fix(genericModal): set closeEdit value to "generic" to fix issue with closing the modal
2023-06-28 11:43:21 -03:00
Lucas Oliveira
0c18aab513 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:35:34 -03:00
Cristhian Zanforlin Lousa
b29a54c678 🔧 fix(AccordionComponent/index.tsx): fix import formatting and add missing semicolon
 feat(AccordionComponent/index.tsx): add support for opening and closing accordion items on click
🔧 fix(popUpContext.tsx): add missing semicolon and fix formatting
 feat(popUpContext.tsx): add closeEdit state and setCloseEdit function to manage closing edit pop-up

🐛 fix(ApiModal/index.tsx): add missing dependencies to useEffect to prevent stale data
 feat(ApiModal/index.tsx): add support for opening and closing accordion when there are tweaks present
🔧 chore(ApiModal/index.tsx): refactor getValue function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor buildContent function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor buildTweakObject function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor onChange functions to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor value props to improve readability and maintainability

🔧 fix(codeAreaModal): add setCloseEdit function to PopUpContext to handle closing editcode
🔧 fix(promptModal): add setCloseEdit function to PopUpContext to handle closing prompt
🔧 fix(textAreaModal): add setCloseEdit function to PopUpContext to handle closing textarea
🔧 fix(components): change value prop to open prop in AccordionComponentType for better semantics
2023-06-28 11:35:30 -03:00
Lucas Oliveira
789a4cb2f8 Fixed bug with template code area 2023-06-28 11:35:30 -03:00
Rodrigo Nader
15e1efc0a1 feat: Add new stylesheet for Switch component
Imported a new stylesheet for the Switch component to enhance its visual appearance.
2023-06-28 11:35:26 -03:00
Gabriel Luiz Freitas Almeida
40179ee011 🔧 chore(validate.py): add input_types to template_field in post_validate_prompt function
The input_types attribute is added to the template_field in the post_validate_prompt function. This change allows for specifying the input types that are accepted for the template field, providing more flexibility and control over the input data.
2023-06-28 11:33:56 -03:00
Gabriel Luiz Freitas Almeida
0ecb531749 🔧 fix(base.py): add input_types property to TemplateFieldCreator class
🔧 fix(index.ts): add input_types property to TemplateVariableType interface
The `input_types` property is added to the `TemplateFieldCreator` class in `base.py` and the `TemplateVariableType` interface in `index.ts`. This change allows for specifying the input types for template fields and template variables, respectively.
2023-06-28 11:33:42 -03:00
Lucas Oliveira
5d2901c7a6 🔧 fix(GenericNode/index.tsx): remove console.log statement for data object
🔥 chore(ProgressBarComponent/index.tsx): delete unused ProgressBarComponent component
🔧 fix(intComponent/index.tsx): remove commented out console.log statement for event object
2023-06-28 11:07:58 -03:00
Lucas Oliveira
9cb85a0c21 🔧 fix(tabsContext.tsx): remove console.log statements for cleaner code
🔧 fix(nodeToolbarComponent/index.tsx): remove console.log statement for cleaner code
🔧 fix(utils.ts): remove console.log statement for cleaner code
2023-06-28 11:07:49 -03:00
Lucas Oliveira
da5aa1e05b Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:01:40 -03:00
Lucas Oliveira
3b1b42fe3e Changed styling on From Chat toggle 2023-06-28 11:01:37 -03:00
Gabriel Luiz Freitas Almeida
6cf9639128 feat: add template to input_keys_response 2023-06-28 10:58:55 -03:00
Gabriel Luiz Freitas Almeida
614bcecec2
Fix: Metadata now updates existing metadata in documents (#560) 2023-06-28 09:32:34 -03:00
Gabriel Luiz Freitas Almeida
e5b12ae05a 🔖 chore(pyproject.toml): update langchain dependency version to ^0.0.218
The langchain dependency version has been updated to ^0.0.218 to ensure compatibility with the latest features and bug fixes.
2023-06-28 09:19:07 -03:00
Gabriel Luiz Freitas Almeida
d79e61f7ed
Merge branch 'main' into release 2023-06-28 09:06:51 -03:00
Gabriel Luiz Freitas Almeida
fe11604976 Merge branch 'release' of https://github.com/logspace-ai/langflow into release 2023-06-28 09:03:30 -03:00
Gabriel Luiz Freitas Almeida
7364ba41f8 🐛 fix(loading.py): handle case where metadata is an empty dict and document already has metadata
🐛 fix(loading.py): handle case where separator_type is not provided in params
The first fix ensures that if the metadata is an empty dict, it will not be added to the documents if they already have metadata. This prevents overwriting existing metadata.

The second fix handles the case where the separator_type is not provided in the params. In this case, the text_splitter will be instantiated using the class_object and the params as is.
2023-06-28 08:59:31 -03:00
Gabriel Luiz Freitas Almeida
b8f150d1ac format 2023-06-28 08:47:42 -03:00
hibad
b25207a33a
Merge branch 'logspace-ai:dev' into dev 2023-06-28 15:20:40 +08:00
zhenjianpeng
d157fffee3 adding pg support for external message persistance 2023-06-28 15:20:06 +08:00
Rodrigo Nader
17380fa2fb feat: Upgrade toggle shad component and switch UI styles
- Improved the scaling effect for the toggle shad component.
- Removed unused switch styles CSS file.
- Updated the switch UI component to have improved color styles for checked and unchecked states.
2023-06-28 01:11:24 -03:00
Lucas Oliveira
264cb8aa30 📝 chore(constants.tsx): update CHAT_FORM_DIALOG_SUBTITLE to provide a more accurate description of its purpose and usage 2023-06-28 00:54:03 -03:00
Lucas Oliveira
a6e5dcaadc Deleted chat modal and changed disposition of clearChat button 2023-06-28 00:44:48 -03:00
Lucas Oliveira
d59b648b75 🔥 refactor(formTrigger): remove unused FormTrigger component
🔥 refactor(chatComponent): remove import and usage of FormTrigger component

🔥 refactor(ui/badge): remove unused size variant in Badge component

🔥 refactor(formModal/chatInput): remove unused Eraser icon import and clearChat function

🔥 refactor(formModal/chatMessage): remove unused classNames import and remove dark mode classes

🔥 refactor(formModal): remove unused Eraser icon import and clearChat function
2023-06-28 00:38:21 -03:00
Cristhian Zanforlin Lousa
4ac1326f3a 🐛 fix(AccordionComponent): remove extra whitespace in AccordionTrigger className for consistent styling
 feat(tabsContext): add setTweak and getTweak functions to TabsContext to manage tweak state

🐛 fix(ApiModal): remove unused imports and console.log statements

 feat(ApiModal): add functionality to get and set tweak state in TabsContext

🐛 fix(ApiModal): fix key prop warning in map function

🐛 fix(ApiModal): fix unused variable warning

 feat(ApiModal): add getValue function to get the value from tweak state or default value

🐛 fix(ApiModal): remove unused onChange functions

🐛 fix(ApiModal): fix key prop warning in map function

🐛 fix(ApiModal): fix unused variable warning

 feat(ApiModal): add functionality to get and set tweak state in TabsContext

🐛 fix(ApiModal): remove unused imports and console.log statements

 feat(tabsContext): add setTweak and getTweak functions to TabsContext to manage tweak state
2023-06-27 23:35:27 -03:00
Gabriel Luiz Freitas Almeida
2e09d7026b 🔀 chore(api): rename message property to inputs in sendAllProps type
The message property in the sendAllProps type has been renamed to inputs to better reflect its purpose. This change improves the semantics of the code and makes it easier to understand the purpose of the property.
2023-06-27 21:33:06 -03:00
Gabriel Luiz Freitas Almeida
c39e94d584 🔨 refactor(base.py): change message parameter to inputs parameter to improve semantics
The message parameter was not being used in the function, so it was changed to inputs to better reflect the purpose of the parameter.
2023-06-27 21:32:46 -03:00
Gabriel Luiz Freitas Almeida
5a9c1ae1b7 🔀 chore(schemas.py): add support for dict type in message field of ChatMessage schema
The message field of the ChatMessage schema now supports a dictionary type in addition to the previous string and None types. This change was made to allow for more complex messages to be sent and received in the chat.
2023-06-27 21:32:09 -03:00
Gabriel Luiz Freitas Almeida
a4101dac53 🔥 refactor(formModal): remove unused imports and variables
 feat(formModal): add function to format message inputs into a string
This commit removes unused imports and variables from the file. A new function was added to format the message inputs into a string, which is used to display the message in the chat. This improves the readability of the code and makes it easier to understand how the message is being constructed.
2023-06-27 21:31:47 -03:00
Lucas Oliveira
e1efeb6b33 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-27 20:58:11 -03:00
Lucas Oliveira
8c721b0b8e 🐛 fix(formModal): fix keysValue state initialization to prevent undefined error
 feat(formModal): add support for memory_keys in input variables accordion to display memory keys in chat form modal
2023-06-27 20:58:01 -03:00
Lucas Oliveira
355b846be4 🎨 style(constants.tsx): add CHAT_FORM_DIALOG_SUBTITLE constant to improve code readability
 feat(formModal): add Input Variables section to Chat Form modal to allow users to input variables
🎨 style(formModal): adjust width of Chat Form modal and Input Variables section to improve UI
🎨 style(formModal): adjust layout of Input Variables section to improve UI
🎨 style(formModal): adjust layout of From Chat switch to improve UI
🐛 fix(formModal): replace Switch component with custom ToggleShadComponent to fix styling issue
2023-06-27 20:54:24 -03:00
Gabriel Luiz Freitas Almeida
526f5847c6 🐛 fix(validate.py): remove unused variables from prompt.frontend_node.template
 feat(validate.py): add support for dynamic template fields in prompt validation
The changes in this commit remove unused variables from the prompt.frontend_node.template. The commit also adds support for dynamic template fields in prompt validation. The new variables are added to the template and the custom_fields list. The old custom_fields list is copied and then updated with the new variables. The variables that are not in the template anymore are removed from the prompt.frontend_node.template.
2023-06-27 20:54:00 -03:00
Cristhian Zanforlin Lousa
132b2e367b 🐛 fix(constants.tsx): add check for empty tweak array to avoid JSON.stringify error 2023-06-27 19:51:53 -03:00
Gabriel Luiz Freitas Almeida
2cf16de113 🐛 fix(validate.py): remove unused template fields from frontend_node
The code now removes any unused template fields from the frontend_node to avoid any potential errors.
2023-06-27 19:51:18 -03:00
Gabriel Luiz Freitas Almeida
aee34c87f2 🐛 fix(parameterComponent): setNodeClass function is now passed down to PromptAreaComponent
The setNodeClass function is now passed down to PromptAreaComponent from ParameterComponent. This allows the nodeClass to be set when a prompt is used.
2023-06-27 19:49:41 -03:00
Gabriel Luiz Freitas Almeida
753eae28c7 🐛 fix(validate.py): change dict() to to_dict() method to fix TypeError
The `dict()` method was causing a TypeError when trying to serialize the `template_field` object. The `to_dict()` method is the correct method to use to serialize the object.
2023-06-27 19:49:30 -03:00
Gabriel Luiz Freitas Almeida
e5676337b5 🐛 fix(utils.ts): add try-catch blocks to handle errors in groupByFamily function
The try-catch blocks were added to handle errors that may occur when the function is called. This improves the robustness of the function and prevents it from crashing when an error occurs.
2023-06-27 19:49:18 -03:00