e01fe86caa🐛 fix(base.py): simplify the logic to find the matched_type in the Edge class The logic to find the matched_type in the Edge class has been simplified by removing unnecessary nested loops and using a single generator expression. This improves the readability and efficiency of the code.
Gabriel Luiz Freitas Almeida
2023-06-30 10:09:56 -03:00
3bdc35d238🔧 chore(llm.py): add function to initialize VertexAI credentials 🔧 chore(loading.py): call initialize_vertexai function when node_type is "VertexAI" The llm.py file now includes a new function initialize_vertexai that initializes the VertexAI credentials if a credentials parameter is provided. This allows for the usage of VertexAI credentials in the application. In loading.py, the initialize_vertexai function is called when the node_type is "VertexAI", ensuring that the VertexAI credentials are properly initialized for that specific node type.
Gabriel Luiz Freitas Almeida
2023-06-30 10:09:29 -03:00
bbf4c38740🔀 refactor(llms.py): simplify condition for showing fields in the VertexAI class The condition for showing fields in the VertexAI class has been simplified to exclude specific field names. This improves readability and maintainability of the code.
Gabriel Luiz Freitas Almeida
2023-06-30 09:35:33 -03:00
e8de0c60ef🔒 chore(pyproject.toml): update python dependency version to >=3.9,<3.11 to ensure compatibility ⬆️ feat(pyproject.toml): add google-cloud-aiplatform dependency to enable integration with Google Cloud AI Platform The python dependency version has been updated to >=3.9,<3.11 to ensure compatibility with the project. Additionally, the google-cloud-aiplatform dependency has been added to enable integration with Google Cloud AI Platform services.
Gabriel Luiz Freitas Almeida
2023-06-30 09:23:17 -03:00
4d72c92e4c🔧 chore(llms.py): add extra fields for VertexAI template and modify field type for "credentials" 📝 chore(llms.py): improve field configuration for VertexAI template and modify field type for "credentials" The add_extra_fields method is modified to add an additional field called "credentials" for the VertexAI template. The field is of type "file" and is required. It allows the user to upload a JSON file as credentials. The format_openai_field method is also updated to handle the new "credentials" field.
Gabriel Luiz Freitas Almeida
2023-06-30 09:00:18 -03:00
3ae84bea13🔧 chore(validate.py): add display_name field to TemplateField in post_validate_prompt function The display_name field is added to the TemplateField object in the post_validate_prompt function. This field allows for a more user-friendly display of the variable name in the UI.
Gabriel Luiz Freitas Almeida
2023-06-30 06:46:00 -03:00
54b5aa65da🔨 refactor(formModal/index.tsx): organize imports and format code for better readability ✨ feat(formModal/index.tsx): add support for dropdown menu component and button component 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting 🐛 fix(formModal/index.tsx): fix type error and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for dropdown menu component and button component 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for dropdown menu component and button component 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for toggle component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for dropdown menu component and button component 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code formatting ✨ feat(formModal/index.tsx): add support for textarea component and handle input value changes correctly 🔧 chore(formModal/index.tsx): fix indentation and spacing issues for better code
Lucas Oliveira
2023-06-30 00:09:34 -03:00
91fc931081Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io
Lucas Oliveira
2023-06-29 23:20:24 -03:00
9acff51555🔧 chore(codeBlock/index.tsx): adjust className to use relative width instead of fixed width to improve responsiveness
Lucas Oliveira
2023-06-29 23:19:44 -03:00
4875098209🐛 fix(formModal/index.tsx): fix initial value of chatValue to correctly retrieve value from tabsState 🐛 fix(formModal/index.tsx): fix initial value of chatKey to correctly retrieve key from tabsState 🐛 fix(formModal/index.tsx): fix handleOnCheckedChange to correctly set chatKey and chatValue 🐛 fix(formModal/index.tsx): fix onChange of Textarea to correctly update tabsState input_keys ✨ feat(formModal/index.tsx): add support for clearing input value when form is submitted ✨ feat(formModal/index.tsx): add support for clearing input value when form is closed
Lucas Oliveira
2023-06-29 23:13:29 -03:00
af84dd2c68🔀 refactor(process.py): rename build_langchain_object_with_caching to build_sorted_vertices_with_caching for better clarity 🐛 fix(process.py): handle missing inputs in process_graph_cached function The function build_langchain_object_with_caching has been renamed to build_sorted_vertices_with_caching to provide a more descriptive name that accurately reflects its purpose. Additionally, the process_graph_cached function now handles cases where the inputs parameter is missing or empty by populating it with values from the artifacts dictionary. This ensures that all required inputs are properly set before running the graph.
Gabriel Luiz Freitas Almeida
2023-06-29 22:49:32 -03:00
e43cbdacb7feat (process.py): The build_sorted_vertices_with_caching function is added to build the sorted vertices of the langchain object with caching. It also uses the memoize_dict decorator to cache the result. The function first builds the langchain object from the data graph, then iterates over the sorted vertices and updates the artifacts dictionary. This ensures that the artifacts are properly updated during the building process.
Gabriel Luiz Freitas Almeida
2023-06-29 22:48:20 -03:00
8546843b0dMerge branch 'form_io' of github.com:logspace-ai/langflow into form_io
Lucas Oliveira
2023-06-29 22:33:09 -03:00
8229bf4b4e🐛 fix(chatInput): adjust padding-right value to align input field properly 🐛 fix(chatMessage): set max-width to prevent overflow of markdown content 🐛 fix(formModal): remove unnecessary badge for handle keys in accordion item
Lucas Oliveira
2023-06-29 22:32:56 -03:00
9a69a71ea1🐛 fix(chat.py): add exception logging to stream_build function to improve error handling The stream_build function now logs the exception that occurred during the flow building process using the logger.exception method. This improves error handling and provides more detailed information about the error in the logs.
Gabriel Luiz Freitas Almeida
2023-06-29 22:07:23 -03:00
766ef28a0c🔧 refactor(base.py): add source_handle, target_handle, and target_param attributes to Edge class The Edge class constructor now takes an additional parameter 'edge' which is a dictionary containing additional information about the edge. This information is used to set the source_handle, target_handle, and target_param attributes of the Edge class. This change allows for more flexibility and extensibility when working with edges in the graph. 🔧 refactor(base.py): add edge parameter to Edge class constructor to pass additional edge information
Gabriel Luiz Freitas Almeida
2023-06-29 22:06:57 -03:00
cfcdb67ed9🚀 feat(base.py): add default values for string and prompt type parameters in _build_params method The unused imports have been removed to improve code cleanliness. The code in the _build_params method has been simplified by removing unnecessary conditions and loops. Default values are now added for string and prompt type parameters to ensure that they have a value even if not explicitly set. 🔧 fix(base.py): remove unused imports and simplify code in _build_params method
Gabriel Luiz Freitas Almeida
2023-06-29 22:05:22 -03:00
966444a88b🐛 fix(formModal/index.tsx): remove unnecessary handle badge from AccordionTrigger and AccordionItem components
Lucas Oliveira
2023-06-29 21:33:05 -03:00
2c4803d28a🔨 refactor(formModal/index.tsx): remove unused code related to handle_keys in the form modal 🔨 refactor(formModal/index.tsx): remove unused code related to handle_keys in the form modal to improve code readability and maintainability
Lucas Oliveira
2023-06-29 21:29:34 -03:00
afd7641063Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io
Lucas Oliveira
2023-06-29 21:14:47 -03:00
e4b03d7765🐛 fix(parameterComponent): import lodash library to use _.cloneDeep function 🐛 fix(chatComponent): import lodash library to use _.cloneDeep function ✨ feat(chatComponent): add TabsContext to access tabsState and update isBuilt state based on tabsState changes
Lucas Oliveira
2023-06-29 21:14:30 -03:00
Merge branch 'main' into release
Gabriel Luiz Freitas Almeida
2023-06-29 20:44:38 -03:00
606779f216🔖 chore(pyproject.toml): update package version to 0.2.7 The package version has been updated from 0.2.6 to 0.2.7. This change is made to reflect the latest changes and improvements in the package.
Gabriel Luiz Freitas Almeida
2023-06-29 20:43:52 -03:00
e98e0b22df🐛 fix(vertex/base.py): add input types from template_dicts to optional_inputs 🐛 fix(interface/initialize/loading.py): handle BaseOutputParser instances in instantiate_prompt The optional_inputs list in the Vertex class is now extended with the input_types from the template_dicts dictionary. This ensures that the optional_inputs list contains all the input types that are not required. In the instantiate_prompt function, if the variable is an instance of BaseOutputParser and has a get_format_instructions method, the format_kwargs dictionary is updated with the result of calling get_format_instructions(). This allows handling BaseOutputParser instances correctly in the instantiate_prompt function.
Gabriel Luiz Freitas Almeida
2023-06-29 20:43:22 -03:00
CSS Color Changes and Dark Mode Implementation - New Style Features (#572)
Gustavo Schaedler
2023-06-30 00:41:27 +01:00
ffebce974f🔨 refactor(formModal): remove unused keysValue state variable to improve code cleanliness and readability 🔨 refactor(formModal): update formKeysData type in tabsState to include handle_keys array for better data structure consistency and completeness
Lucas Oliveira
2023-06-29 20:34:31 -03:00
fce7b398f7Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io
Lucas Oliveira
2023-06-29 20:30:44 -03:00
21174c0e8bFixed key problem
Lucas Oliveira
2023-06-29 20:30:39 -03:00
dd009a2913feat: Add support for Custom Component in Langflow Interface
gustavoschaedler
2023-06-30 00:23:50 +01:00
Adding New Components, XSS treatment in the chat, other fixes (#571)
Gustavo Schaedler
2023-06-29 23:52:12 +01:00
4039540148🐛 fix(GenericNode): add strokeWidth property to Icon component to fix styling issue 🐛 fix(NodeModal): add strokeWidth property to Icon component to fix styling issue 🐛 fix(DisclosureComponent): add strokeWidth property to Icon component to fix styling issue 🐛 fix(extraSidebarComponent): add strokeWidth property to Icon components to fix styling issue
Cristhian Zanforlin Lousa
2023-06-29 19:51:28 -03:00
ca32bc3ab5📦 chore(poetry.lock): update strenum package version to 0.4.15 The strenum package has been updated from version 0.4.12 to version 0.4.15. This update may include bug fixes, performance improvements, or new features.
Gabriel Luiz Freitas Almeida
2023-06-29 19:46:33 -03:00
9fe13ca52d🔀 chore(test_llms_template.py): rename base class from "Serializable" to "BaseLLM" for clarity and consistency The base class "Serializable" has been renamed to "BaseLLM" to provide a more descriptive and consistent name for the class. This change improves clarity and maintainability of the code.
Gabriel Luiz Freitas Almeida
2023-06-29 19:46:08 -03:00
a8d7edff7a🔧 fix(frontend): update class names and colors in singleAlertComponent and NoticeAlert components to match the new design 🔧 fix(frontend): update class names and colors in index.css to match the new design 🔧 fix(frontend): update tailwind.config.js to use the new color variable name 'status-blue' instead of 'medium-dark-blue'
Cristhian Zanforlin Lousa
2023-06-29 19:45:22 -03:00
Flow Tweaks (#567)
Gabriel Luiz Freitas Almeida
2023-06-29 19:39:10 -03:00
60032d6146🐛 fix(AccordionComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(codeAreaComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(dropdownComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(floatComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(inputFileComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(inputListComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(intComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(promptComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(textAreaComponent): fix formatting and add missing semicolons to improve code readability and maintainability 🐛 fix(ui/accordion.tsx): fix formatting and add missing semicolons to improve code readability and maintainability
Gabriel Luiz Freitas Almeida
2023-06-29 19:36:22 -03:00
b188400517🐛 fix(loading.py): improve error message formatting when failing to build connection to database 🐛 fix(base.py): add optional 'name' parameter to the format method in FieldFormatter In loading.py, the error message when failing to build a connection to the database is now formatted in a more readable way. This improves the clarity of the error message and makes it easier to identify the cause of the issue.
Gabriel Luiz Freitas Almeida
2023-06-29 19:36:04 -03:00
1743edfd1d🐛 fix(loading.py): handle case when "handle_keys" is not in params dictionary and add input_variable to "handle_keys" list The code now checks if the "handle_keys" key is present in the params dictionary. If it is not present, it creates an empty list and adds the input_variable to it. This ensures that the "handle_keys" list is always present and the input_variable is correctly added to it.
Gabriel Luiz Freitas Almeida
2023-06-29 19:31:01 -03:00
d6bd8a1a1b🔧 chore(utils.py): add support for handle_keys in build_input_keys_response function The build_input_keys_response function now includes support for handle_keys in the response. This allows the function to populate the handle_keys field in the response with the values from the artifacts dictionary, if available.
Gabriel Luiz Freitas Almeida
2023-06-29 19:30:51 -03:00
Merge branch 'release' into feat-tweaks
Gabriel Luiz Freitas Almeida
2023-06-29 19:22:12 -03:00
356719f115Connection made successfully at the handle nodes
Lucas Oliveira
2023-06-29 19:19:06 -03:00
879390488e🔖 chore(pyproject.toml): update package version to 0.2.7 The package version has been updated from 0.2.6 to 0.2.7. This change is made to reflect the latest changes and improvements in the package.
Gabriel Luiz Freitas Almeida
2023-06-29 19:06:50 -03:00
Merge branch 'main' into release
Gabriel Luiz Freitas Almeida
2023-06-29 19:05:10 -03:00
eb53798c41🐛 fix(utils.ts): update color code for "retrievers" in nodeColors object The color code for the "retrievers" category in the nodeColors object has been updated from "#F5B85A" to "#e6b25a". This change was made to ensure consistency and improve the visual representation of the "retrievers" category.
Gabriel Luiz Freitas Almeida
2023-06-29 18:43:37 -03:00
4f94662881📝 docs(config.yaml): add documentation for ConversationEntityMemory integration The ConversationEntityMemory integration is now documented in the config.yaml file. This provides a link to the documentation for using the ConversationEntityMemory module with SQLite as the underlying storage. This change improves the clarity and accessibility of the documentation for this integration.
Gabriel Luiz Freitas Almeida
2023-06-29 18:43:24 -03:00
82c469d3c2🔥 refactor(constants.tsx): remove console.log statements for better code cleanliness and performance
Cristhian Zanforlin Lousa
2023-06-29 18:42:40 -03:00
fdb998688a🐛 fix(codeAreaComponent): update initial state of myValue to handle non-string values properly
Cristhian Zanforlin Lousa
2023-06-29 18:42:09 -03:00
2b33334de6🔒 chore(poetry.lock): update google-api-python-client version to 2.91.0 🔒 chore(poetry.lock): update joblib version to 1.3.1 The versions of the anthropic, google-api-python-client, and joblib packages have been updated to their latest versions. This ensures that the application is using the most recent bug fixes, improvements, and features provided by these packages.
Gabriel Luiz Freitas Almeida
2023-06-29 18:41:23 -03:00
27b17a13c2Refactor styles and class names in multiple components, update color variables, and adjust button and control styles.
Rodrigo Nader
2023-06-29 18:39:00 -03:00
08c7bb5230🐛 fix(loading.py): catch additional exception when object has no 'conn' field to improve error handling The code now catches an additional exception when the object does not have a 'conn' field. This improves the error handling by providing a more specific error message when building a connection to the database fails.
Gabriel Luiz Freitas Almeida
2023-06-29 18:38:36 -03:00
4761eda9a0🔀 chore(base.py): add 'SQLiteEntityStore' to 'from_method_nodes' dictionary The 'from_method_nodes' dictionary in the 'MemoryCreator' class in 'base.py' has been updated to include the 'SQLiteEntityStore' class and its '__init__' method. This change allows the 'SQLiteEntityStore' class to be used as a memory node in the LangFlow application.
Gabriel Luiz Freitas Almeida
2023-06-29 18:38:08 -03:00
6fa295b8a8🐛 fix(memories.py): fix condition to add extra fields in MemoryFrontendNode class ✨ feat(memories.py): add show attribute to entity_store field in MemoryFrontendNode class The condition to add extra fields in the MemoryFrontendNode class has been fixed to correctly check if any of the base classes are in a list of base message classes. Additionally, the show attribute has been added to the entity_store field in the MemoryFrontendNode class to control its visibility.
Gabriel Luiz Freitas Almeida
2023-06-29 18:37:52 -03:00
c834d91efd🐛 fix(util.py): exclude "kwargs" and "args" parameters from the generated template dictionary The "kwargs" and "args" parameters are now excluded from the generated template dictionary. This ensures that only the relevant parameters are included in the template, improving the accuracy and usefulness of the generated template.
Gabriel Luiz Freitas Almeida
2023-06-29 18:37:33 -03:00
f81a835001🐛 fix(process.py): add error handling for unknown langchain_object types When processing the data graph, if the langchain_object is of an unknown type, a ValueError is now raised. This provides better error handling and helps identify any unexpected langchain_object types that may be encountered during processing.
Gabriel Luiz Freitas Almeida
2023-06-29 18:19:22 -03:00
7eeacfbb31🐛 fix(base.py): add support for creating MemoryFrontendNode from a method ✨ feat(base.py): add support for creating MemoryFrontendNode from a specific method in ZepChatMessageHistory class The MemoryCreator class now supports creating MemoryFrontendNode from a specific method in the ZepChatMessageHistory class. This is achieved by adding the from_method_nodes dictionary with the method name as the key and the class name as the value. The build_template_from_method function is used to create the MemoryFrontendNode from the specified method. This enhancement allows for more flexibility in creating MemoryFrontendNode instances.
Gabriel Luiz Freitas Almeida
2023-06-29 17:39:46 -03:00
77cc23bf5f🐛 fix(base.py): fix method name in build_template_from_method call for MultiQueryRetriever ✨ feat(base.py): add support for ZepRetriever in from_method_nodes dictionary The build_template_from_method call for the MultiQueryRetriever in the get_signature method was using the incorrect method name "from_llm". It has been fixed to use the correct method name "from_method_nodes". Additionally, support for the ZepRetriever has been added to the from_method_nodes dictionary to allow for its usage in the RetrieverCreator class.
Gabriel Luiz Freitas Almeida
2023-06-29 17:39:36 -03:00
e24ad0513b🔧 chore(memories.py): set 'url' field to be shown in the frontend The 'url' field in the MemoryFrontendNode class is now set to be shown in the frontend. This change allows the 'url' field to be visible and accessible to users in the frontend interface.
Gabriel Luiz Freitas Almeida
2023-06-29 17:39:25 -03:00
26c42cac05🔧 chore(util.py): exclude "self" parameter from template building The "self" parameter is now excluded from the template building process. This change improves the accuracy of the generated template by removing unnecessary information.
Gabriel Luiz Freitas Almeida
2023-06-29 17:39:12 -03:00
9e44720ac8🔧 chore(config.yaml): comment out unused integrations in memories and retrievers sections The unused integrations in the memories and retrievers sections have been commented out to improve code readability and remove unnecessary clutter. These integrations are not currently being used in the application and can be safely ignored.
Gabriel Luiz Freitas Almeida
2023-06-29 17:38:58 -03:00
c0dbafe49frefactor(components): Update CSS classes in codeAreaComponent, floatComponent, intComponent, and dialog
Rodrigo Nader
2023-06-29 16:49:24 -03:00
a41c8552a8🎨 style(parameterComponent): add full width to the div container for better layout consistency
Cristhian Zanforlin Lousa
2023-06-29 16:42:38 -03:00
5522b51d6b🐛 fix(parameterComponent): add margin-top to the container divs to improve spacing between elements
Cristhian Zanforlin Lousa
2023-06-29 16:41:41 -03:00
9bf5adcd7a🔧 chore(extraSidebarComponent/index.tsx): center align the input field in the extra sidebar component for better visual consistency
Cristhian Zanforlin Lousa
2023-06-29 15:24:01 -03:00
473bde940c🐛 fix(loading.py): add error handling for missing 'cursor' attribute in instantiate_memory function The instantiate_memory function now includes error handling for a specific AttributeError that occurs when the object does not have a 'cursor' attribute. If this error occurs, an AttributeError is raised with a specific error message indicating a failure to build a connection to the database. This change improves the error handling and provides more informative error messages for debugging purposes.
Gabriel Luiz Freitas Almeida
2023-06-29 15:17:23 -03:00
Fixed broken link (#568)
Gabriel Luiz Freitas Almeida
2023-06-29 14:31:48 -03:00
7c777bf692🐛 fix(ApiModal/index.tsx): fix linting issues and improve code readability ✨ feat(ApiModal/index.tsx): add support for displaying tweaks code in a separate tab if there are any tweaks present
Cristhian Zanforlin Lousa
2023-06-29 14:17:55 -03:00
3ced33b678🔧 chore(base.py): add method to remove unwanted base classes from the list of base classes 🐛 fix(base.py): call the method to remove unwanted base classes before converting the frontend node to a dict The process_base_classes method is added to the FrontendNode class to remove unwanted base classes from the list of base classes. This method iterates over the base classes and filters out any classes that are present in the CLASSES_TO_REMOVE list. The method is then called before converting the frontend node to a dictionary representation in the to_dict method to ensure that the unwanted base classes are not included in the final output.
Gabriel Luiz Freitas Almeida
2023-06-29 13:07:04 -03:00
c180a6c644🔀 chore(config.yaml): comment out unused wrapper and prompt template configurations The configurations for the ChatPromptTemplate, SystemMessagePromptTemplate, and HumanMessagePromptTemplate wrappers have been commented out as they are currently not being used. This helps to improve code readability and reduces unnecessary clutter in the configuration file.
Gabriel Luiz Freitas Almeida
2023-06-29 12:59:25 -03:00
84718246e1🔧 chore(config.yaml): add output_parsers section with StructuredOutputParser and ResponseSchema The config.yaml file now includes an output_parsers section with the StructuredOutputParser and ResponseSchema as the specified parsers. This change was made to enhance the functionality of the backend by enabling the parsing of structured output and response schemas.
Gabriel Luiz Freitas Almeida
2023-06-29 12:57:31 -03:00
3167330cbc🔧 fix(validate.py): add "BaseOutputParser" to the list of input_types in the template_field 🔧 fix(settings.py): add "output_parsers" attribute to the Settings class The "input_types" list in the template_field of the post_validate_prompt function in validate.py was missing the "BaseOutputParser" type. This fix adds it to the list to ensure proper validation.
Gabriel Luiz Freitas Almeida
2023-06-29 12:57:16 -03:00
e87a475584🔀 refactor(constants.py): import vertex types from langflow.graph.vertex.types instead of individual imports The import statements for vertex types in constants.py have been refactored to import all types from langflow.graph.vertex.types. This improves code readability and maintainability by reducing the number of import statements and consolidating them into a single import.
Gabriel Luiz Freitas Almeida
2023-06-29 12:57:04 -03:00
c6d8d62ffd🚧 chore(types.py): add OutputParserVertex class to support output parsing functionality The OutputParserVertex class is added to the types.py file. This class extends the Vertex class and is used to represent a vertex in the graph that performs output parsing. It takes a data parameter of type Dict in its constructor and calls the super constructor with the data and a base_type of "output_parsers". This change is made to support the implementation of output parsing functionality in the graph.
Gabriel Luiz Freitas Almeida
2023-06-29 12:56:50 -03:00
5e00debae4🔧 fix(utils.py): add import statement for output_parsers module 🔧 fix(loading.py): add import statement for output_parser_creator 🔧 fix(listing.py): add import statement for output_parser_creator 🔧 fix(types.py): add import statement for output_parser_creator The import statements for the output_parsers module were missing in the respective files. This fix adds the necessary import statements to ensure that the output_parser_creator is accessible and can be used in the code.
Gabriel Luiz Freitas Almeida
2023-06-29 12:56:36 -03:00
fa3bcdefee📦 chore(output_parsers): add output parsers module and base classes 🚀 feat(output_parsers): add OutputParserCreator class to handle creation and loading of output parsers 🚀 feat(output_parsers): add OutputParserFrontendNode class to handle formatting of output parser fields The commit adds the following changes: - A new file __init__.py is added to the output_parsers module. - A new file base.py is added to the output_parsers module. - A new file output_parsers.py is added to the frontend_node module. The __init__.py file initializes the OutputParserCreator class, which is responsible for creating and loading output parsers. It also defines a method to get the signature of an output parser. The base.py file contains the base class OutputParserCreator which is a subclass of LangChainTypeCreator. It defines the type name as "output_parsers" and provides methods to get the frontend node class and the type to loader dictionary. It also defines a method to convert the output parsers to a list. The output_parsers.py file contains the OutputParserFrontendNode class, which is a subclass of FrontendNode. It provides a method to format the field of an output parser. These changes are done to add support for output parsers in the application. The OutputParserCreator class allows for dynamic creation and loading of output parsers, while the OutputParserFrontendNode class provides a way to format the fields of an output parser.
Gabriel Luiz Freitas Almeida
2023-06-29 12:55:58 -03:00
e9a907babe🔧 chore(utils.ts): add support for output_parsers node color and icon 🚀 feat(utils.ts): add support for output_parsers node name and icon The nodeColors object now includes a color for the output_parsers node type, allowing it to be visually distinguished. Similarly, the nodeNames object now includes a name for the output_parsers node type. Additionally, the nodeIconsLucide object now includes an icon for the output_parsers node type. These changes improve the consistency and completeness of the node types in the application.
Gabriel Luiz Freitas Almeida
2023-06-29 12:55:26 -03:00
7d8304cb60chore(codeAreaModal): adjust height of code area and error message container for better UI fix(codeAreaModal): fix styling issue with scrollbar height in code area
anovazzi1
2023-06-29 11:51:03 -03:00
2876afa79a🐛 fix(loading.py): fix formatting of input variables in instantiate_prompt function The instantiate_prompt function now properly formats the input variables before passing them to the prompt object. If the input variable is a string, it is passed as is. If the input variable is a list of Document objects, it is formatted to contain the page_content and metadata as one string separated by a newline. This ensures that the prompt object receives the correct input format.
Gabriel Luiz Freitas Almeida
2023-06-29 11:44:51 -03:00
1be3de50c5Changes to only make the Prompt Check run once
Lucas Oliveira
2023-06-29 11:30:00 -03:00
18b2226b12Fixed bug where the node internals are not updated at the PromptTemplate
Lucas Oliveira
2023-06-29 11:25:48 -03:00
549a8dedc5🔧 chore(llms.py): add method to add extra base classes to improve extensibility The add_extra_base_classes method is added to the LLMFrontendNode class. This method checks if the "BaseLLM" class is already present in the base_classes list and appends it if not. This change allows for easier extensibility by providing a way to add additional base classes to the LLMFrontendNode class.
Gabriel Luiz Freitas Almeida
2023-06-29 11:18:19 -03:00
8cc0497120🔀 refactor(base.py): add from_method_nodes dictionary to RetrieverCreator class The from_method_nodes dictionary is added to the RetrieverCreator class in order to map the "MultiQueryRetriever" node to the "from_llm" method. This refactor improves the readability and maintainability of the code by explicitly defining the mapping between nodes and methods.
Gabriel Luiz Freitas Almeida
2023-06-29 11:18:11 -03:00
72b6681f5a🔧 chore(loading.py): add support for instantiating retrievers in the initialization process 🚀 feat(loading.py): implement the ability to instantiate retrievers based on node type and class object The instantiate_based_on_type function now includes a new condition to handle the instantiation of retrievers. The instantiate_retriever function is introduced to handle the specific logic for creating retrievers. This change allows for the dynamic creation of retrievers based on the provided node type and class object.
Gabriel Luiz Freitas Almeida
2023-06-29 11:17:59 -03:00
6b893237d0🐛 fix(utils.py): add import_retriever function to import retriever module ✨ feat(utils.py): add support for importing retriever module based on retriever name The import_retriever function is added to the utils.py module to allow importing the retriever module based on the retriever name. This function uses the import_module function from the importlib module to dynamically import the retriever module from the langchain.retrievers package. This enhances the modularity and extensibility of the codebase by providing a convenient way to import retrievers based on their names.
Gabriel Luiz Freitas Almeida
2023-06-29 11:17:30 -03:00
8fe7cd3472Merge branch 'python_custom_node_component' of personal:logspace-ai/langflow into python_custom_node_component
anovazzi1
2023-06-29 11:16:32 -03:00
6ef5e56c5c✨ feat(graph): add RetrieverVertex to the list of available vertex types The RetrieverVertex class is added to the list of available vertex types in the langflow.graph.vertex.types module. This allows for the creation of vertices that represent retrievers in the graph.
Gabriel Luiz Freitas Almeida
2023-06-29 11:16:05 -03:00
f1de9a554d🔀 refactor(constants.py): import vertex types from langflow.graph.vertex.types as types for improved readability and maintainability
Gabriel Luiz Freitas Almeida
2023-06-29 11:15:51 -03:00
f1e2bbb69c🐛 fix(chat.py): change BuildStatus.IN_PROGRESS to BuildStatus.STARTED for better clarity 🐛 fix(chat.py): fix incorrect key used to retrieve graph_data from flow_data_store The BuildStatus.IN_PROGRESS constant is changed to BuildStatus.STARTED to provide a more accurate representation of the flow status. Additionally, the incorrect key "data" is replaced with "graph_data" when retrieving the graph data from the flow_data_store dictionary.
Gabriel Luiz Freitas Almeida
2023-06-29 10:54:27 -03:00
c954f8d338🐛 fix(AccordionComponent): fix the logic to set the initial value of the accordion based on the open prop array ✨ feat(AccordionComponent): add support for multiple open accordions by changing the open prop from boolean to string array 🐛 fix(constants.tsx): remove escape characters from the JSON stringified tweaks to fix parsing issues ✨ feat(constants.tsx): add support for tweaks dictionary in the getCurlCode and getPythonCode functions 🐛 fix(ApiModal): fix the logic to set the initial value of the openAccordion state based on the getTweak array ✨ feat(ApiModal): add support for opening accordions based on the getTweak array when switching to the Tweak tab 🐛 fix(ApiModal): fix the logic to filter and remove empty tweaks from the tweak.current array ✨ feat(ApiModal): add support for adding new tweaks to the tweak.current array and generating Python API code 🐛 fix(ApiModal): fix the logic to get the value of a specific tweak template based on the node id and template name ✨ feat(ApiModal): add support for opening accordions based on the tweak.current array when switching to the Tweak tab 🐛 fix(types): add missing newline at the end of the file
Cristhian Zanforlin Lousa
2023-06-29 10:44:32 -03:00
3faf5f5b96🐛 fix(chatMessage): sanitize HTML content to prevent potential XSS attacks ✨ feat(chatMessage): improve rendering of multi-line messages The convert variable is now imported before being used to convert ANSI to HTML. Additionally, the DOMPurify library is imported and used to sanitize the HTML content before rendering it, preventing potential XSS attacks. The rendering of multi-line messages has been improved by splitting the message by newline characters and rendering each line separately with a line break.
Gabriel Luiz Freitas Almeida
2023-06-29 10:02:28 -03:00
e1bf25a4ff📦 chore(frontend): add dompurify package as a dependency The dompurify package is added as a dependency to the frontend package.json file. This package is needed for sanitizing HTML to prevent cross-site scripting (XSS) attacks.
Gabriel Luiz Freitas Almeida
2023-06-29 09:59:31 -03:00
19828da830🐛 fix(utils.ts): rename Search icon to FileSearch for better clarity and accuracy The Search icon has been renamed to FileSearch to provide a more accurate representation of its purpose. This change improves clarity and ensures that the icon name aligns with its actual functionality.
Gabriel Luiz Freitas Almeida
2023-06-29 09:57:09 -03:00
894fd16e8e✨ feat(retrievers): add base retriever class and frontend node class 🐛 fix(util.py): handle non-string types in format_dict function The base retriever class is added to provide a common interface for all retrievers in the language chain. The frontend node class for retrievers is also added to handle the formatting of fields specific to retrievers.
Gabriel Luiz Freitas Almeida
2023-06-29 09:56:59 -03:00
302efa103a✨ feat(retrievers): add __init__.py file to retrievers directory The __init__.py file is added to the retrievers directory to make it a Python package. This allows the directory to be recognized as a module and enables importing of modules and submodules within the retrievers directory.
Gabriel Luiz Freitas Almeida
2023-06-29 09:56:26 -03:00
28e770992b🚀 feat(listing.py): add support for retrievers in the type dictionary The type dictionary in the listing.py file now includes a "retrievers" key, which contains a list of retriever creators. This allows for the inclusion of retrievers as a supported type in the application.
Gabriel Luiz Freitas Almeida
2023-06-29 09:56:17 -03:00
f427e17166🔀 refactor(endpoints.py): rename import of build_langchain_types_dict to langchain_types_dict for consistency 🔀 refactor(types.py): add langchain_types_dict as a separate variable to improve code readability and maintainability
Gabriel Luiz Freitas Almeida
2023-06-29 09:55:59 -03:00