Commit graph

11,593 commits

Author SHA1 Message Date
ogabrielluiz
f8d3eb1824 refactor: Improve ParameterComponent logic and handle output preview
Refactor the ParameterComponent in index.tsx to improve the logic for displaying the output preview. Also, handle the case where there are outputs available for the selected output name. This change enhances the functionality and user experience of the component.
2024-06-13 00:41:07 -03:00
ogabrielluiz
d1946fa351 feat: Add FilterDataComponent for filtering Message objects based on a list of strings 2024-06-13 00:27:06 -03:00
ogabrielluiz
22268409ee refactor: Update Message class in message.py to inherit from Data
Update the Message class in message.py to inherit from the Data class. This change ensures consistency and improves the organization of the codebase.
2024-06-13 00:26:19 -03:00
ogabrielluiz
c956aed61b refactor: Update Message.from_data method parameter name
Update the Message.from_data method in message.py to change the parameter name from "record" to "data". This change improves clarity and consistency in the codebase.
2024-06-13 00:20:20 -03:00
ogabrielluiz
f823d5ccf7 refactor: Update ChatInput and ChatOutput to handle Message input
Update the ChatInput and ChatOutput components in ChatInput.py and ChatOutput.py to handle Message input. If the input value is an instance of the Message class, extract the text attribute and use it as the input value. This change ensures compatibility with the langflow schema and improves the flexibility of the components.
2024-06-13 00:16:44 -03:00
ogabrielluiz
36da9172e7 (TextInput.py): Add MultilineInput class to support multiline input for data_template field
♻️ (TextInput.py): Remove unnecessary code for handling Message type input_value in text_response method
2024-06-13 00:06:51 -03:00
ogabrielluiz
bb847db2b8 refactor: Fix bug in Vertex class when checking if param is a list
Update the Vertex class in base.py to fix a bug in the logic for checking if a parameter is a list. The current implementation only checks if the "list" key exists in the template_dict, but it should also check if the value of the "list" key is truthy. This change ensures that the correct condition is used to determine if a parameter is a list, preventing potential overwriting of params with the same name but different target_id.
2024-06-13 00:04:44 -03:00
Rodrigo
00c83d4b9b refactor: Update TextInput to handle Message input
Update the TextInput component in TextInput.py to handle Message input. If the input value is an instance of the Message class, extract the text attribute and use it as the input value. This change ensures compatibility with the langflow schema and improves the flexibility of the component.
2024-06-13 00:03:36 -03:00
ogabrielluiz
7b09d1cc51 refactor: Add MultilineInput class for handling multiline text inputs 2024-06-13 00:02:37 -03:00
ogabrielluiz
3f363bf1f6 refactor: Handle array log results in switchOutputView component
Update the switchOutputView component to handle array log results. If the log results are an array, an error message is logged and the component returns early. This change ensures proper handling of different types of log results and improves the reliability of the component.
2024-06-12 23:51:38 -03:00
ogabrielluiz
eb85f1d462 refactor: Update StrInput class to include default value
Update the StrInput class in inputs.py to include a default value of an empty string. This change ensures consistency and improves the usability of the class.
2024-06-12 23:50:57 -03:00
ogabrielluiz
72649a034a refactor: Update ChatOutput to use MultilineInput for text input
Update the ChatOutput class in ChatOutput.py to use the MultilineInput class from the langflow library for text input. This change improves the usability and flexibility of the component, allowing for multiline messages to be passed as output.
2024-06-12 23:50:49 -03:00
Rodrigo
b362ab0be6 refactor: Update TextInput display name and info
Update the display name and info of the TextInput component in TextInput.py to improve clarity and consistency. The display name is changed to "Text" and the info is updated to reflect that it expects text input. This change aligns with recent updates to the langflow library and enhances the usability of the component.
2024-06-12 23:34:55 -03:00
ogabrielluiz
8a75315249 refactor: Update CustomComponent to use StrInput and Output classes
Update the CustomComponent class in CustomComponent.py to use the StrInput and Output classes from the langflow library. This change ensures compatibility with the latest langflow updates and improves the clarity and consistency of the code.
2024-06-12 23:27:42 -03:00
Rodrigo
0a9ef2cde0 refactor: Update URLComponent and FileComponent to use langflow custom Component class
Refactor the URLComponent and FileComponent classes to inherit from the langflow custom Component class instead of the deprecated CustomComponent class. This change ensures compatibility with the latest langflow library updates and improves the maintainability of the code.
2024-06-12 23:26:44 -03:00
ogabrielluiz
259bdcbd95 refactor: Add MultilineInput class for handling multiline text inputs 2024-06-12 23:24:45 -03:00
ogabrielluiz
1774fdebe6 📝 (loading.py): Update the logic in build_custom_component function to handle cases where raw is None and improve artifact_type assignment for better accuracy
📝 (chat.py): Remove commented out code related to logs in build_vertex function for better code readability
📝 (schemas.py): Change the type of logs field in ResultDataResponse class to be a dictionary with string keys and Log values for consistency
📝 (schema.py): Refactor build_logs_from_artifacts function to use a dictionary instead of defaultdict for logs variable for simplicity and consistency
2024-06-12 23:24:35 -03:00
ogabrielluiz
ccb9ba3307 refactor: Improve GenericModal coloredContent function
Update the coloredContent function in GenericModal to ensure the input value is converted to a string before applying replacements. This change improves the reliability and consistency of the function.
2024-06-12 23:23:33 -03:00
ogabrielluiz
40ce88b9ea refactor: Update logs field in ResultDataResponse schema
Update the logs field in the ResultDataResponse schema to allow for a list of logs or a single log. This change ensures compatibility with the latest langflow library updates and improves the flexibility of the schema.
2024-06-12 22:44:23 -03:00
ogabrielluiz
6357d245aa refactor: Rename 'hide' to 'hidden' in field classes
Update the field classes in the codebase to use the 'hidden' attribute instead of 'hide' for consistency and clarity. This change aligns with recent updates to the langflow library and improves the readability of the code.
2024-06-12 22:16:41 -03:00
ogabrielluiz
150841d9cf refactor: Remove unused input field in TextInput.py 2024-06-12 22:14:50 -03:00
Rodrigo
47cb35fd9c refactor: Update imports in TextInput.py
Update the imports in TextInput.py to match the latest changes in the langflow library. This ensures compatibility and consistency with the rest of the codebase.
2024-06-12 19:49:24 -03:00
Lucas Oliveira
3bd1a96506 Fixed components with Hide element 2024-06-12 19:42:20 -03:00
Lucas Oliveira
c65f2e1ab1 Added Hide Outputs functionality 2024-06-12 19:41:45 -03:00
Rodrigo
b0e6e42115 ```text
refactor: Add value attribute to ChatInput

Add a new value attribute to the ChatInput class in ChatInput.py. This allows for the pre-filling of the input field with a default value.
2024-06-12 19:41:25 -03:00
anovazzi1
643772c216 Merge branch 'two_edges' of personal:langflow-ai/langflow into two_edges 2024-06-12 18:55:15 -03:00
anovazzi1
fddc5fac75 refactor: Update MESSAGES_TABLE_ORDER constant in constants.ts
Update the MESSAGES_TABLE_ORDER constant in constants.ts to include additional fields for sorting messages in a table. This change improves the functionality and flexibility of the codebase, allowing for more customizable table sorting options.
2024-06-12 18:55:09 -03:00
anovazzi1
ae49081776 refactor: Update OutputComponent to use name instead of selected when types.length < 2 2024-06-12 18:54:56 -03:00
ogabrielluiz
16089ea5b2 Another batch of renaming Record to Data 2024-06-12 18:18:03 -03:00
ogabrielluiz
e827789a09 format 2024-06-12 17:59:33 -03:00
ogabrielluiz
1d0056f4fc rename Record to Data 2024-06-12 17:59:32 -03:00
ogabrielluiz
a562ae5b0b refactor: Update logs field type in ResultDataResponse schema 2024-06-12 17:58:42 -03:00
ogabrielluiz
9716a29911 refactor: Update logs field type in ResultDataResponse schema
Update the logs field type in the ResultDataResponse schema of schemas.py to use a single Log object instead of a list of Log objects. This change aligns the schema with the actual data structure and improves consistency throughout the codebase.
2024-06-12 17:58:42 -03:00
ogabrielluiz
0f31e5517e refactor: Update build_vertex function to handle logs and result data response
Refactor the build_vertex function in chat.py to handle logs and result data response more efficiently. Instead of using a conditional statement to check the type of vertex.artifacts_raw, the code now directly assigns the logs variable based on the type. Additionally, the logs variable is only assigned to result_data_response if it is not empty. This change improves the clarity and maintainability of the code.
2024-06-12 17:58:42 -03:00
ogabrielluiz
dc37f279e0 refactor: Update Log message field to allow list type
Update the Log class in schema.py to allow the message field to accept a list type in addition to str, dict, and StreamURL. This change enhances the flexibility of the Log class and accommodates scenarios where multiple messages need to be stored.
2024-06-12 17:58:42 -03:00
Rodrigo
2a1c6e76a5 refactor: Update ChatInput inputs to use specific input classes
Update the inputs of the ChatInput class in ChatInput.py to use specific input classes such as StrInput and DropdownInput. This change improves the organization and separation of concerns in the codebase, making it easier to understand and maintain.
2024-06-12 17:52:12 -03:00
Rodrigo
1ee717ed4e refactor: Update ChatOutput inputs to use specific input classes 2024-06-12 17:50:17 -03:00
ogabrielluiz
f3a06381b6 Update projects 2024-06-12 16:18:09 -03:00
ogabrielluiz
cd5cba112e refactor: Update Template class fields and serialization
Update the Template class in base.py to include a serialization alias for the type_name field and use the InputTypes class for the fields list. This refactor improves the organization and maintainability of the codebase by providing clearer field definitions and serialization behavior.
2024-06-12 16:17:57 -03:00
ogabrielluiz
e23e2cf1fe refactor: Update field input classes for different data types 2024-06-12 16:17:24 -03:00
ogabrielluiz
58edd9694b refactor: Remove unused code in update_template_field function 2024-06-12 16:16:09 -03:00
ogabrielluiz
3ac8bf99eb refactor: Update PromptComponent inputs to use PromptInput
Update the inputs of the PromptComponent class in Prompt.py to use the PromptInput class instead of the deprecated Input class. This change improves the organization and separation of concerns in the codebase, making it easier to understand and maintain.
2024-06-12 16:16:00 -03:00
ogabrielluiz
8511c2ebad refactor: Update ChatOutput inputs to use specific input classes
Update the inputs of the ChatOutput class in ChatOutput.py to use specific input classes such as StrInput, DropdownInput, and BoolInput. This change improves the organization and separation of concerns in the codebase, making it easier to understand and maintain.
2024-06-12 16:14:48 -03:00
ogabrielluiz
a81e81b0fc refactor: Update ChatInput inputs to use specific input classes
Update the inputs of the ChatInput class in ChatInput.py to use specific input classes such as StrInput and DropdownInput. This change improves the organization and separation of concerns in the codebase, making it easier to understand and maintain.
2024-06-12 16:14:09 -03:00
ogabrielluiz
13ef60c4e3 refactor: Remove unused code in update_template_field function
Remove the unused code block in the update_template_field function in utils.py. The code block was checking for the "load_from_db" key in the value_dict and assigning it to the "load_from_db" attribute of the template_field dictionary. However, this attribute is no longer used in the codebase, so the code block can be safely removed. This change improves the clarity and maintainability of the code.
2024-06-12 16:13:29 -03:00
ogabrielluiz
01d396e037 refactor: Update BaseInputMixin to include model_serializer and serialize_model method
This commit updates the `BaseInputMixin` class in the `input_mixin.py` file. It adds the `model_serializer` decorator and the `serialize_model` method to the mixin. The `model_serializer` decorator is used to specify the serialization behavior of the model, and the `serialize_model` method is responsible for serializing the model into a dictionary representation.

These additions enhance the flexibility and reusability of the `BaseInputMixin` class.
2024-06-12 16:11:39 -03:00
ogabrielluiz
f65380f12c refactor: Update OpenAIModelComponent inputs and model response method
This commit updates the inputs of the `OpenAIModelComponent` class in the `OpenAIModel.py` file. It replaces the `Input` class with specific input classes such as `StrInput`, `IntInput`, `DictInput`, `DropdownInput`, `BoolInput`, and `SecretStrInput`. This change improves the organization and separation of concerns in the codebase, making it easier to understand and maintain.

Additionally, the commit renames the `model_response` method to `build_model` for better clarity and consistency. The method is responsible for constructing the language model using the specified input values and returning the built model.

These updates enhance the functionality and maintainability of the `OpenAIModelComponent` class.
2024-06-12 13:54:12 -03:00
ogabrielluiz
8b87c0ef92 refactor: Update field input classes and module structure 2024-06-12 13:54:04 -03:00
ogabrielluiz
e7be07ebec refactor: Update field input classes for different data types
This commit adds field input classes for different data types in the `inputs.py` file. The purpose of this change is to improve the organization and separation of concerns in the codebase. Each input class specifies the field type and provides default values or options where applicable. This update enhances the maintainability and extensibility of the codebase.
2024-06-12 12:34:38 -03:00
ogabrielluiz
edbdce7531 refactor: Add BaseInputMixin for common input field attributes and methods
This commit adds the `BaseInputMixin` class to the `input_mixin.py` file. The `BaseInputMixin` provides common input field attributes and methods for input fields in the codebase. This mixin includes attributes such as `field_type`, `required`, `placeholder`, `show`, `value`, `name`, `display_name`, `advanced`, `input_types`, `dynamic`, `info`, `real_time_refresh`, `refresh_button`, `refresh_button_text`, and `title_case`. The mixin also includes a `to_dict` method for converting the input field to a dictionary representation. This addition improves the organization and reusability of the codebase.
2024-06-12 12:28:28 -03:00