Commit graph

7,638 commits

Author SHA1 Message Date
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
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
0200b22189 🎨 style(nodeToolbarComponent): add noopener and noreferrer attributes to documentation link
The noopener and noreferrer attributes were added to the documentation link to improve security by preventing the linked page from having access to the window.opener object and to prevent the referrer header from being sent to the linked page, respectively.
2023-06-27 18:26:01 -03:00
Gabriel Luiz Freitas Almeida
f3e22b0080 fix: docs open in a new tab now 2023-06-27 18:25:05 -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
Gabriel Luiz Freitas Almeida
ab77792d65 🔨 refactor(parameterComponent): improve code readability by adding line breaks and indentation
🔨 refactor(promptComponent): add nodeClass prop to improve code consistency
🔨 refactor(genericModal): add nodeClass prop to improve code consistency
🔨 refactor(types/components): remove unused imports and add nodeClass prop to TextAreaComponentType
The changes made in the code aim to improve code readability and consistency. The ParameterComponent, PromptAreaComponent, and GenericModal components now have a nodeClass prop to improve consistency with the naming conventions. The TextAreaComponentType now has a nodeClass prop to improve consistency with the other components.
2023-06-27 18:22:48 -03:00
Gabriel Luiz Freitas Almeida
bc4edde8d7 Merge remote-tracking branch 'origin/python_custom_node_component' into form_io 2023-06-27 18:05:14 -03:00
Gabriel Luiz Freitas Almeida
43c06e0c4f Merge remote-tracking branch 'origin/dynamicNode' into form_io 2023-06-27 18:01:11 -03:00
Gabriel Luiz Freitas Almeida
c0b1a12766 🐛 fix(API/index.ts): add frontend_node parameter to checkPrompt function to fix validation errors
The checkPrompt function was not properly validating prompts due to missing frontend_node parameter. The fix adds the frontend_node parameter to the function and passes it to the axios.post request.
2023-06-27 17:59:57 -03:00
Lucas Oliveira
d52829dad7 🎉 feat(frontend): add Accordion component to improve UI/UX
🔧 chore(frontend): add keyframes and animations for Accordion component to tailwind.config.js
2023-06-27 17:55:32 -03:00
Lucas Oliveira
f1556f2446 feat(chat): improve chat UI and add support for chat history display and sending messages 2023-06-27 17:53:46 -03:00
Cristhian Zanforlin Lousa
ebee617b52 🔨 refactor(constants.tsx): add optional parameter to getPythonApiCode, getCurlCode and getPythonCode functions to allow tweaking of the flow
 feat(ApiModal): pass the tweak.current value to the getPythonApiCode, getCurlCode and getPythonCode functions to allow tweaking of the flow. Update the tabs with the new code after a tweak is added.
2023-06-27 17:24:19 -03:00
Cristhian Zanforlin Lousa
c6b3986bc9 Adding accordion, tweaks tabs 2023-06-27 17:02:41 -03:00
Lucas Oliveira
d1a58397da Passed data through context to get form keys 2023-06-27 16:57:21 -03:00
Gabriel Luiz Freitas Almeida
6a3f89c2b9 feat: adding VertexAI
Issue #290
2023-06-27 16:53:48 -03:00
anovazzi1
f5211d4ef0 bugfix: sendind string code 2023-06-27 16:40:00 -03:00
Gabriel Luiz Freitas Almeida
3c1b86ebe6 🐛 fix(chat.py): change event name from "input_keys" to "message" in stream_build function
The event name was changed from "input_keys" to "message" to improve semantics and consistency with the rest of the codebase.
2023-06-27 16:38:42 -03:00
anovazzi1
08b20e18cb feat(API): add postCustomComponent function to create custom components
fix(modals): replace UpdateTemplate function with postCustomComponent function to create custom components
2023-06-27 16:26:27 -03:00
anovazzi1
cfa7dd6800 Merge branch 'dynamicNode' into python_custom_node_component 2023-06-27 16:25:26 -03:00
Gabriel Luiz Freitas Almeida
2497561cd3 🚀 feat(API): add postCustomComponent function to send custom component code to the server
🚀 feat(CodeAreaModal): replace UpdateTemplate function with postCustomComponent function to send custom component code to the server
The UpdateTemplate function was not being used and was removed. The postCustomComponent function was added to send custom component code to the server. The CodeAreaModal component was updated to use the new postCustomComponent function instead of the UpdateTemplate function to send custom component code to the server.
2023-06-27 15:44:55 -03:00
Gabriel Luiz Freitas Almeida
2ec01afd8b 🎨 style(nodeToolbarComponent): update button colors and icons for better visibility and consistency
🐛 fix(nodeToolbarComponent): fix documentation link not working when no documentation is provided
The button colors and icons have been updated to improve visibility and consistency. The delete and copy buttons now have a darker background color when hovered over. The edit button now has a rounded right corner and a lighter background color when there are no nodes present. The documentation button now shows a "Coming Soon" tooltip when no documentation is provided and has a muted color. The documentation link now works correctly even when no documentation is provided.
2023-06-27 15:39:31 -03:00
Gabriel Luiz Freitas Almeida
37239e27c9 🎨 style(extraSidebarComponent): remove delayDuration from ShadTooltip component
The delayDuration prop was removed from all ShadTooltip components in the ExtraSidebar component. This improves the user experience by removing the delay before the tooltip is displayed.
2023-06-27 15:29:40 -03:00
Gabriel Luiz Freitas Almeida
0a3648c23e 🔨 refactor(GenericNode): remove unused imports and simplify documentation tooltip
The required indicator is now next to the title, which improves readability and makes it easier to see which parameters are required. The documentation tooltip has been simplified to only show the documentation link, which improves the user experience by reducing clutter. Unused imports have been removed to improve code quality.
🔨 refactor(parameterComponent): move required indicator next to title
2023-06-27 15:29:20 -03:00
Gabriel Luiz Freitas Almeida
e10d271e22 🔧 refactor(ShadTooltipComponent): destructure props and add types
The ShadTooltipComponent has been refactored to destructure the props and add types to improve readability and maintainability. The ShadTooltipProps type has been added to the types/components/index.ts file to define the expected props for the ShadTooltipComponent. The delayDuration, side, content, and children props are now destructured from the props object and have their respective types defined.
2023-06-27 15:26:53 -03:00
gustavoschaedler
5d430f9364 Refactor ClassCodeExtractor to extract the entrypoint function arguments and return type\nAdd validation of correct format for custom_component code\nAdd function to build a template for custom_component with its code as a field value. 2023-06-27 19:25:44 +01:00
Gabriel Luiz Freitas Almeida
23cf37eee5 🔖 chore(pyproject.toml): update package version to 0.2.3
🔥 refactor(manager.py): remove unnecessary blank line at the end of the file
The package version has been updated to 0.2.3 in the pyproject.toml file. This is a chore as it does not affect the functionality of the package. The blank line at the end of the manager.py file has been removed as it is unnecessary and does not add any value to the code. This is a refactor as it improves the code readability.
2023-06-27 13:21:40 -03:00
Gabriel Luiz Freitas Almeida
ae5f04a1b0
Merge branch 'release' into bugfix-duplicate 2023-06-27 13:15:49 -03:00
Lucas Oliveira
54891277c6 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-27 12:40:51 -03:00
Lucas Oliveira
a0ea6647eb Initial changes on form modal 2023-06-27 12:40:45 -03:00
Gabriel Luiz Freitas Almeida
3a5cd957c3
Added info parameter to fields (#552) 2023-06-27 12:10:53 -03:00
Gabriel Luiz Freitas Almeida
8107f9e332 feat(loading.py): add support for new prompt templates in instantiate_prompt function
The config.yaml file has been updated to include new prompt templates. In types.py, the input_variables list was not being cleared when prompt or messages were present, which has been fixed. The instantiate_prompt function in loading.py has been updated to support the new prompt templates.
🔀 chore(config): add new prompt templates to config.yaml
🐛 fix(types.py): fix input_variables not being cleared when prompt or messages are present
2023-06-27 12:06:23 -03:00
Gabriel Luiz Freitas Almeida
93c3f7a2a6 feat(__main__.py): add optional static_files_dir parameter to setup_app function
The variable name static_files_dir was changed to improve semantics. It is now more clear that it is a directory path. An optional static_files_dir parameter was added to the setup_app function to allow for a directory path to be passed in. This allows for more flexibility in serving static files.
🐛 fix(__main__.py): fix static_files_dir variable name to improve semantics
2023-06-27 11:09:26 -03:00
Gabriel Luiz Freitas Almeida
b741853454 🔧 chore(utils.py): use ChatConfig to set streaming option
The first change removes an extra blank line in the ChatManager class. The second change updates the try_setting_streaming_options function to use the ChatConfig class to set the streaming option instead of hardcoding it. This makes the code more modular and easier to maintain.
2023-06-27 10:16:41 -03:00
Gabriel Luiz Freitas Almeida
7c6845b15e 🔧 chore(loading.py): add instantiate_llm function to handle LLM instantiation and set ChatConfig.streaming based on openai_api_base parameter
This commit adds a new function `instantiate_llm` to handle LLM (Language Model) instantiation. It also sets the `ChatConfig.streaming` attribute based on the `openai_api_base` parameter. This is a workaround to ensure that JinaChat works until streaming is implemented.
2023-06-27 10:16:19 -03:00
Gabriel Luiz Freitas Almeida
c86f72e7a6 🎉 feat(config.py): add ChatConfig class with streaming attribute set to True
The ChatConfig class is added to the project with a single attribute, streaming, set to True. This attribute is used to determine whether the chatbot should use streaming or request-response communication with the client.
2023-06-27 10:11:39 -03:00