Commit graph

2,506 commits

Author SHA1 Message Date
Lucas Oliveira
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
2023-06-29 22:32:56 -03:00
Lucas Oliveira
966444a88b 🐛 fix(formModal/index.tsx): remove unnecessary handle badge from AccordionTrigger and AccordionItem components 2023-06-29 21:33:05 -03:00
Lucas Oliveira
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
2023-06-29 21:29:34 -03:00
Lucas Oliveira
afd7641063 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 21:14:47 -03:00
Lucas Oliveira
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
2023-06-29 21:14:30 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 20:43:22 -03:00
Lucas Oliveira
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
2023-06-29 20:34:31 -03:00
Lucas Oliveira
fce7b398f7 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-29 20:30:44 -03:00
Lucas Oliveira
21174c0e8b Fixed key problem 2023-06-29 20:30:39 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 19:31:01 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 19:30:51 -03:00
Lucas Oliveira
356719f115 Connection made successfully at the handle nodes 2023-06-29 19:19:06 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:59:25 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:57:31 -03:00
Gabriel Luiz Freitas Almeida
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.

The Settings class in settings.py was missing the "output_parsers" attribute. This fix adds the attribute to the class to ensure that the list of output parsers can be properly configured and accessed.
2023-06-29 12:57:16 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:57:04 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:56:50 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:56:36 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:55:58 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 12:55:26 -03:00
Gabriel Luiz Freitas Almeida
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.
2023-06-29 11:44:51 -03:00
Lucas Oliveira
1be3de50c5 Changes to only make the Prompt Check run once 2023-06-29 11:30:00 -03:00
Lucas Oliveira
18b2226b12 Fixed bug where the node internals are not updated at the PromptTemplate 2023-06-29 11:25:48 -03:00
Lucas Oliveira
dadaaa895d 🔥 refactor(chatComponent/index.tsx): remove unnecessary console.log statements for 'open' and 'isBuilt' variables 2023-06-28 18:17:37 -03:00
Lucas Oliveira
657dfa1bb6 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 18:17:21 -03:00
Lucas Oliveira
7b2763a1af 🐛 fix(parameterComponent): set isPending to true for each tab in the parameter component state to fix a bug
🐛 fix(chatComponent): remove console.log statements for 'open' and 'isBuilt' variables to clean up code
🐛 fix(formModal): remove unnecessary console.log statement for 'tabsState[id.current]' variable to clean up code
🐛 fix(PageComponent): set isPending to true for each tab in the Page component state to fix a bug
2023-06-28 18:16:59 -03:00
Gabriel Luiz Freitas Almeida
a445b079e0 🔧 refactor(loading.py): simplify instantiation of prompt and format_kwargs assignment
💡 chore(loading.py): improve code readability and maintainability by simplifying the instantiation of the prompt object and assignment of format_kwargs dictionary.

The code has been refactored to use a dictionary comprehension to create the format_kwargs dictionary. This simplifies the logic and improves code readability. The commented out code for the prompt.partial() method has been removed as it is no longer necessary.
2023-06-28 17:59:57 -03:00
Lucas Oliveira
3bd103dbc5 🔨 refactor(promptComponent): move postValidatePrompt import statement to the top of the file for better organization
🔥 chore(promptModal): remove unused promptModal component

🔨 refactor(promptComponent): use useEffect to make a POST request to validate the prompt value and update the nodeClass state if the API returns data
2023-06-28 17:42:58 -03:00
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