Commit graph

2,441 commits

Author SHA1 Message Date
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
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
Lucas Oliveira
d1a58397da Passed data through context to get form keys 2023-06-27 16:57:21 -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
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
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
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
d3a2367932 🚀 feat(custom.py): add AgentType enum to improve readability and type safety
The `AgentType` enum is added to the `langchain.agents.custom` module to improve readability and type safety. The `InitializeAgent` class now uses the `AgentType` enum to ensure that the `agent` parameter is a valid value from the enum.
2023-06-26 13:27:34 -03:00
Lucas Oliveira
2b08969c0d 🎨 style(chatTrigger, formTrigger, formModal): change absolute positioning to fixed positioning to improve UI layout and consistency, added ShadCN modal 2023-06-26 12:00:53 -03:00
Lucas Oliveira
ea65c58682 🐛 fix(chatComponent): fix ChatTrigger and FormTrigger open state to open when either of them is clicked 2023-06-26 11:48:25 -03:00
Lucas Oliveira
4303e9efb0 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-26 11:45:31 -03:00
Lucas Oliveira
90cc4023e5 Added form button to bottom right and copied chat modal 2023-06-26 11:45:27 -03:00
Gabriel Luiz Freitas Almeida
89286c6456 🔨 refactor(utils.py): extract build_input_keys_response function to improve code reusability
🚀 feat(chat.py): use build_input_keys_response function to build input keys response
The build_input_keys_response function was extracted from the remove_api_keys function to improve code reusability. It builds the input keys response object, which contains the input keys and memory keys of a langchain object. The chat.py file now uses this function to build the input keys response object instead of building it manually. This improves code readability and reduces code duplication.
2023-06-26 10:52:53 -03:00
Lucas Oliveira
466d583103 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-26 10:34:43 -03:00
Lucas Oliveira
5a6d75a38c 🔥 chore(.gitignore): remove .githooks/prepare-commit-msg from git tracking to avoid committing hooks accidentally 2023-06-26 10:23:00 -03:00
Gabriel Luiz Freitas Almeida
423caa5ddc 🔍 chore(.gitignore): add prepare-commit-msg to avoid pushing Opencommit hook
The prepare-commit-msg file is added to the .gitignore file to avoid pushing the Opencommit hook to the remote repository. This is done to prevent the hook from being executed on other machines and to avoid any issues that may arise from the hook being executed on different machines.
2023-06-26 10:22:27 -03:00
Gabriel Luiz Freitas Almeida
ebcaedb840 feat(base.py): add input validation for PromptTemplate to ensure that the template and input variables are valid
The commented out code was removed to improve code readability. Input validation was added to ensure that the template and input variables are valid before creating a PromptTemplate object. This helps to prevent errors that may occur when the object is created with invalid input.
🔒 chore(base.py): remove commented out code and add input validation for PromptTemplate
2023-06-26 10:20:48 -03:00
Gabriel Luiz Freitas Almeida
ff0abf5183 🔧 refactor(chat.py): refactor stream_build function to send input_keys to the client
The stream_build function has been refactored to send input_keys to the client if the langchain_object has the attribute "input_keys". This change improves the user experience by providing the client with the necessary input keys to continue the conversation.
2023-06-26 10:20:28 -03:00
Rodrigo Nader
ae71a54a06
Main (#543) 2023-06-25 20:08:33 -03:00
Rodrigo Nader
f373d18502
Fix Icons, Add LLM Caching (#542)
- Fixed Icons that were not set properly on refactor.
- Added LLM Caching
2023-06-25 20:03:53 -03:00
Gabriel Luiz Freitas Almeida
a3efa8fe5d 🐛 fix(utils.py): fix import order to avoid import errors
The import order was changed to avoid import errors. The import of langchain was moved to the top of the file to avoid circular import errors.
2023-06-25 19:52:49 -03:00
Gabriel Luiz Freitas Almeida
31ee134ee7 Merge branch 'llm_caching' into release 2023-06-25 19:51:56 -03:00
Gabriel Luiz Freitas Almeida
5cd809ea6a 🔼 chore(pyproject.toml): update langchain dependency to version 0.0.215
🔼 chore(pyproject.toml): bump package version to 0.2.1
The langchain dependency has been updated to version 0.0.215, which includes bug fixes and performance improvements. The package version has been bumped to 0.2.1 to reflect the changes made.
2023-06-25 19:45:00 -03:00
Gabriel Luiz Freitas Almeida
6f9e6922df 🐛 fix(utils.ts): correct typo in MidjourneyIcon import
The import statement for the MidjourneyIcon was misspelled as MidjorneyIcon, which caused a runtime error. This commit fixes the typo by changing the import statement to MidjourneyIcon.
2023-06-25 19:42:56 -03:00
Gabriel Luiz Freitas Almeida
263ca75fd5 feat(utils.ts): add new icons to nodeIconsLucide
The import of Boxes and LayoutDashboard were removed as they were not being used in the file. New icons were added to nodeIconsLucide to improve the variety of icons available for use. The new icons added are MongoDBAtlasVectorSearch, Pinecone, and SupabaseVectorStore.
🔥 chore(utils.ts): remove unused import of Boxes and LayoutDashboard
2023-06-25 19:39:30 -03:00
Gabriel Luiz Freitas Almeida
a2197bfeb5 🐛 fix(Midjorney): fix typo in import statement and component name
The import statement and component name were both misspelled as "Midjorney" instead of "Midjourney". This commit fixes the typo in both places.
2023-06-25 19:39:20 -03:00
Naveen Choudhary
31f3b74c90 Update pyproject.toml 2023-06-25 19:35:39 -03:00
Gabriel Luiz Freitas Almeida
5f56384dce 🚀 feat(__main__.py): add support for cache configuration
The `update_settings` function now accepts a `cache` parameter that allows the user to specify the type of cache to use. The `cache` parameter is set to a default value of `SQLiteCache` and can be overridden by setting the `LANGCHAIN_CACHE` environment variable. This feature improves the flexibility of the application as it allows the user to choose the type of cache that best suits their needs.
2023-06-25 18:20:21 -03:00