Commit graph

2,478 commits

Author SHA1 Message Date
Lucas Oliveira
a50e089401 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 17:31:14 -03:00
Lucas Oliveira
18acd7e257 🐛 fix(formModal/index.tsx): add missing setTabsState function to TabsContext to fix error
🐛 fix(formModal/index.tsx): update formKeysData.input_keys value when chatValue changes to reflect user input
2023-06-28 17:31:10 -03:00
Gabriel Luiz Freitas Almeida
bb377d4935 🐛 fix(utils.py): set input keys values from artifacts in build_input_keys_response function
 feat(utils.py): add support for setting input keys values from artifacts in build_input_keys_response function
The build_input_keys_response function now takes an additional parameter, artifacts, which is a dictionary containing key-value pairs. The function sets the values of the input keys in the input_keys_response dictionary based on the corresponding keys in the artifacts dictionary. This allows for more flexibility in setting the input keys values dynamically based on the provided artifacts.
2023-06-28 17:27:28 -03:00
Gabriel Luiz Freitas Almeida
d0da0bb1ca 🐛 fix(chat.py): add support for artifacts in stream_build function to pass prompt variables to build_input_keys_response
 feat(chat.py): update build_input_keys_response function to accept artifacts parameter to set input_keys values
The stream_build function now supports the artifacts parameter, which allows passing prompt variables to the build_input_keys_response function. This ensures that the input_keys values are correctly set based on the provided artifacts. The build_input_keys_response function has been updated to accept the artifacts parameter and use it to set the input_keys values. This improves the functionality of the chat module by allowing more flexibility in handling prompt variables.
2023-06-28 17:27:18 -03:00
Gabriel Luiz Freitas Almeida
03349bf999 🐛 fix(vertex/base.py): add artifacts attribute to Vertex class to store additional data
🐛 fix(vertex/base.py): update instantiation logic to handle tuple result from loading.instantiate_class()
🐛 fix(loading.py): update return value of instantiate_prompt() to return a tuple of prompt and format_kwargs
The Vertex class now has a new attribute called artifacts, which is a dictionary used to store additional data related to the vertex. The instantiation logic in the Vertex class has been updated to handle the case where loading.instantiate_class() returns a tuple containing the built object and additional artifacts. The loading.instantiate_prompt() function now returns a tuple containing the prompt and format_kwargs. These changes fix issues related to storing and handling additional data in the vertex and loading modules.
2023-06-28 17:26:57 -03:00
Lucas Oliveira
78ffad4c85 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 17:13:43 -03:00
Lucas Oliveira
9d556bc94c 🐛 fix(chatComponent): remove unused openForm state variable
🐛 fix(formModal): remove console.log statement
🐛 fix(formModal): fix formatMessage function to handle string inputs correctly
2023-06-28 17:13:32 -03:00
Gabriel Luiz Freitas Almeida
6afca21e5a 🐛 fix(utils.py): fix build_input_keys_response function to correctly filter out memory variables from input keys
The build_input_keys_response function now correctly filters out memory variables from the input keys response. Previously, it was using a list comprehension to filter the keys, but it should have been using a dictionary comprehension to preserve the key-value pairs. This fix ensures that only the keys that are not present in the langchain_object's memory variables are included in the input keys response.
2023-06-28 17:13:06 -03:00
Gabriel Luiz Freitas Almeida
c9bb88933b 🔧 chore(chat.py): reset chat history when building a flow to ensure a clean state
The chat history is now reset when building a flow to ensure that the chat starts with a clean state. This helps prevent any potential issues or conflicts that may arise from previous chat interactions.
2023-06-28 16:51:02 -03:00
Gabriel Luiz Freitas Almeida
a0919cb649 🐛 fix(validate.py): set "input_variables" field to new list of variables if it exists
🐛 fix(loading.py): set input variable values if they are present in params
The "input_variables" field in the prompt's frontend_node template is now updated with the new list of variables, if it exists. This ensures that the input variables are correctly set when validating the prompt. In the loading module, the input variable values are now set if they are present in the params dictionary. This ensures that the prompt is correctly instantiated with the provided input variable values.
2023-06-28 16:43:51 -03:00
Lucas Oliveira
16fc6bc4a2 🐛 fix(formModal/index.tsx): fix type of intermediate_steps property to be a string instead of "string" to prevent type error
🐛 fix(formModal/index.tsx): format chatItem.message only if it is not from a bot to improve readability
🐛 fix(formModal/index.tsx): remove unnecessary console.log statement
2023-06-28 16:38:21 -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
Lucas Oliveira
0c18aab513 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:35:34 -03:00
Lucas Oliveira
789a4cb2f8 Fixed bug with template code area 2023-06-28 11:35:30 -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
b8f150d1ac format 2023-06-28 08:47:42 -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
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
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
Lucas Oliveira
5a62bdc592 🐛 fix(formModal): replace double quotes with single quotes to improve consistency and avoid escaping 2023-06-27 19:35:16 -03:00
Lucas Oliveira
64fa0c0dcb 🎨 style(chatInput.tsx): add padding to the chat input to improve readability and aesthetics
🎨 style(chatMessage.tsx): change icon from MessageCircle to MessageSquare to improve semantics
🎨 style(index.tsx): add new icons to the import statement and change MessageSquareDashed to MessageSquare to improve semantics. Add padding to the chat modal to improve aesthetics.
2023-06-27 19:31:37 -03:00
Gabriel Luiz Freitas Almeida
5a57de5425 🔨 refactor(promptComponent, genericModal, promptModal, API): rename checkPrompt to postValidatePrompt
 feat(promptComponent, genericModal): add setNodeClass prop to PromptAreaComponent and GenericModal to update nodeClass
The checkPrompt function has been renamed to postValidatePrompt to better reflect its functionality. The PromptTypeAPI now includes a frontend_node property, which is used to update the nodeClass in the PromptAreaComponent and GenericModal components. The setNodeClass prop has been added to both components to allow for updating the nodeClass.
2023-06-27 19:18:35 -03:00
Gabriel Luiz Freitas Almeida
e760f22847 🐛 fix(base.py): change frontend_node field in ValidatePromptRequest to use FrontendNodeRequest instead of FrontendNode
🔥 chore(base.py): remove unused FrontendNodeRequest class
🔨 refactor(validate.py): modify post_validate_prompt function to update the template field in the frontend_node object
The ValidatePromptRequest class was using the FrontendNode class instead of the FrontendNodeRequest class, which caused an error. The unused FrontendNodeRequest class was removed. The post_validate_prompt function was modified to update the template field in the frontend_node object instead of appending to the fields list.
2023-06-27 19:18:34 -03:00
Gabriel Luiz Freitas Almeida
47494dd9a8 🔥 chore(endpoints.py): remove unused custom_component endpoint
The custom_component endpoint was commented out and unused. It has been removed to improve code readability and maintainability.
2023-06-27 19:18:32 -03:00
Lucas Oliveira
2f5d721ba8 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-27 19:15:56 -03:00
Lucas Oliveira
0e81dafc0e 🎨 style(chatMessage.tsx): remove unused classNames and add primary color to chat message text
🚀 feat(formModal.tsx): add support for multiple input keys and values to be sent in the chat message
🐛 fix(formModal.tsx): fix keysValue state initialization and message object creation
🚀 feat(formModal.tsx): add switch component to select which input key to send in the chat message
🎨 style(formModal.tsx): add muted background color to input keys container
🐛 fix(api/index.ts): change message type to any to support multiple input keys and values
2023-06-27 19:15:44 -03:00
Lucas Oliveira
bbdcb7c6b6 🎨 style(chatMessage): refactor chat message component styles to improve readability and remove unnecessary code
 feat(formModal): add accordion component to display form keys and memory keys in the chat form modal
2023-06-27 18:46:13 -03:00
Gabriel Luiz Freitas Almeida
38404e1243 🚀 feat(frontend_node): add custom_fields attribute to FrontendNode class
The FrontendNode class now has a new attribute called custom_fields, which is a list of strings. This attribute can be used to store any custom fields that are specific to a particular frontend node. This change allows for more flexibility in the data that can be stored in a FrontendNode object.
2023-06-27 18:23:38 -03:00
Gabriel Luiz Freitas Almeida
880fa5034f 🚀 feat(api): add support for frontend_node in validate_prompt endpoint
 feat(base.py): add frontend_node parameter to ValidatePromptRequest and PromptValidationResponse models
The validate_prompt endpoint now accepts a frontend_node parameter in the ValidatePromptRequest model. This parameter is used to add input variables to the frontend_node's template fields and custom fields. The PromptValidationResponse model now includes the frontend_node parameter to return the updated frontend_node object.
2023-06-27 18:23:12 -03:00