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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Allow the "Text" field in the MessagesPage component to be editable along with the "Sender Name" and "Message" fields. This change improves the functionality of the component and provides a better user experience.
Add field input classes for different data types in the `inputs.py` file. This change allows for better 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 improves the maintainability and extensibility of the codebase.
Refactor the type processing logic in base.py to use the newly created post_process_type function for better readability and maintainability. Move the type extraction functions from custom_component.py to the type_extraction module for better organization and separation of concerns. Update import statements in utils.py to reflect the move of type extraction functions. Add functions to type_extraction.py to extract inner types and union types from generic aliases for type extraction operations.
📝 (custom_component.py): Move type extraction functions to type_extraction module for better organization and separation of concerns
📝 (utils.py): Update import statements to reflect the move of type extraction functions to type_extraction module
📝 (type_extraction.py): Add functions to extract inner types and union types from generic aliases for type extraction operations
Allow the "Text" field in the SessionView component to be editable along with the "Sender Name" and "Message" fields. This change improves the functionality of the component and provides a better user experience.
Refactor the get_component_instance function in utils.py to handle the instantiation of custom components. This change ensures compatibility with the latest version of the langflow library and improves code readability.
Handle the case where inputs are missing in custom components by setting them to None and logging a warning. This ensures compatibility with the latest version of the langflow library and improves code robustness.
Refactor the OpenAIModelComponent in OpenAIModel.py to use the BaseLanguageModel field type from langflow.field_typing and the langflow.template module. This change ensures compatibility with the latest version of the langflow library and improves code readability.
Update the LCModelComponent class in model.py to inherit from the Component class instead of the deprecated CustomComponent class. Also, update the import statement for the Component class. This change ensures compatibility with the latest version of the langflow library and improves code readability.
Refactor the instantiation of the custom component in the endpoints.py file. Replace the usage of the deprecated CustomComponent class with the Component class. This change ensures compatibility with the latest version of the langflow library and improves code readability.
Update the Input field type in the base.py file to allow None as the default value for the 'value' attribute. This change ensures consistency and improves code readability.
Refactor the ChatOutput and InterfaceVertex classes to improve message handling. In ChatOutput, remove the unnecessary storage of the message response and update the text_response method to only store the message if a session ID is present. In InterfaceVertex, update the text_output assignment to handle different scenarios and ensure the correct text is used. Also, update the message assignment to handle instances of Message and str. These changes improve the code logic and maintain consistency in message handling across the components.
Update the VertexAIEmbeddingsComponent to use the `Embeddings` field type instead of importing it from `langchain_google_vertexai`. This ensures compatibility with the latest version of the langflow library and improves code readability.
Update the langflow components to use the `Prompt` field type instead of the deprecated `type` attribute. This ensures compatibility with the latest version of the langflow library and improves code readability.