Commit graph

12,775 commits

Author SHA1 Message Date
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
cristhianzl
148e7fb4ae ]Merge branch 'dev' of https://github.com/langflow-ai/langflow into dev 2024-06-12 15:49:09 -03:00
cristhianzl
5c9af97bb1 Refactor chatView component to handle artifacts in chat messages 2024-06-12 15:47:15 -03:00
cristhianzl
ca0f5112bc refactor: Fix condition for required fields in MessageModel 2024-06-12 15:47:03 -03:00
italojohnny
20405ffc01 change default openai model to gpt3.5 2024-06-12 15:21:44 -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
anovazzi1
fdf44f6bc8
Refactor chatView component and improve error handling (#2144)
* Refactor chatView component to handle artifacts in chat messages, fixing bug on streamed messages after refresh

* Improve error handling and error messages in CustomNodes hooks to provide more informative and user-friendly error messages. This ensures that users are aware of any unexpected errors that occur while updating or adding components, and prompts them to try again. This change also aligns with recent improvements in error handling across the codebase.

* ♻️ (utils.ts): remove unnecessary trailing commas in function parameters

*  (frontend): add constants for error messages in CustomNodes hooks
♻️ (frontend): refactor error handling in CustomNodes hooks to use constants

* feat: Add constants for error messages in CustomNodes hooks

Refactor error handling in CustomNodes hooks to use constants for error messages. This improves code readability and maintainability, ensuring consistent error messages are displayed to users. This change aligns with recent improvements in error handling across the codebase.

* refactor: Improve error handling and error messages in CustomNodes hooks

* refactor: Improve error handling and error messages in CustomNodes hooks

* refactor: Improve error handling and error messages in CustomNodes hooks

* refactor: Add missing click event in codeAreaModalComponent.spec.ts

* refactor: Update cURL code generation to use icon-Copy test ID for button click

* refactor: Improve error handling and error messages in CustomNodes hooks

* refactor: Remove unnecessary click event in logs.spec.ts

* refactor: Fix XPath selectors in textInputOutput.spec.ts

* fix python api test

* refactor: Update cURL code generation to use icon-Copy test ID for button click

* fix save component

* refactor: Update API key selection in userSettings.spec.ts

* refactor: Update promptModalComponent.spec.ts

* refactor: Update chatInputOutput.spec.ts for zoom out functionality

* refactor: Add return_message option to ChatInput build_config

* fix streaming

* update example

* update example name

* refactor: Update chatInputOutputUser.spec.ts test to improve readability and maintainability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-06-12 13:05:31 -03:00
cristhianzl
e86e698aa0 Merge branch 'dev' of https://github.com/langflow-ai/langflow into dev 2024-06-12 12:43:42 -03:00
cristhianzl
191fae732c ♻️ (GenericNode): refactor to use optional chaining for template fields
♻️ (count-handles): refactor to use optional chaining for template fields

♻️ (get-nodes-with-default-value): refactor to use optional chaining

♻️ (nodeToolbarComponent): refactor to use optional chaining for template fields

💡 (utils.ts): remove unnecessary trailing commas in function parameters to improve code readability and consistency
2024-06-12 12:43:35 -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
ogabrielluiz
e3d2b9ff28 chore: Update package versions in pyproject.toml and poetry.lock 2024-06-12 12:26:36 -03:00
cristhianzl
b48caa0b82 fix outdated component on memory conversation 2024-06-12 12:10:50 -03:00
anovazzi1
3224227f58 Merge branch 'two_edges' of personal:langflow-ai/langflow into two_edges 2024-06-12 11:01:39 -03:00
anovazzi1
00ae568d4b refactor: Update MessagesPage component to allow editing of "Text" field
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.
2024-06-12 11:01:33 -03:00
cristhianzl
7fc92e2e9c 🐛 (flowSettingsModal): set isSaving to false on error to fix loading state 2024-06-12 10:59:22 -03:00
ogabrielluiz
7762404e6f refactor: Update OllamaModel.py to use field_type instead of type for input definition 2024-06-12 10:45:29 -03:00
ogabrielluiz
d32b6bd031 refactor: Add field input classes for different data types
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.
2024-06-12 10:45:24 -03:00
ogabrielluiz
e5fe8be38e refactor: Refactor type processing logic, move type extraction functions, and update import statements
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.
2024-06-12 10:45:16 -03:00
ogabrielluiz
f2c30be721 📝 (base.py): Refactor type processing logic to use the newly created post_process_type function for better readability and maintainability
📝 (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
2024-06-12 10:44:36 -03:00
ogabrielluiz
d7f119ab1d refactor: Remove test-results/.last-run.json file
Remove the test-results/.last-run.json file, which is no longer needed. This change cleans up the repository and removes unnecessary files.
2024-06-12 10:42:47 -03:00
Nicolò Boschi
968ec28fbc
docker: force python version to 3.12.3 (#2148)
* docker: force python version to 3.12.3

* also fixes pydantic

* remove ci build - too slow

* use lock file for deps

* use poetry.lock

* use poetry.lock
2024-06-12 06:09:46 -07:00
Nicolò Boschi
9261bc0a6f
docker: add customizable port for frontend image (#2147) 2024-06-12 06:08:23 -07:00
anovazzi1
400c851d7a refactor: Update SessionView component to allow editing of "Text" field
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.
2024-06-12 10:05:03 -03:00
Rodrigo
2d277b6e19 refactor: Update PromptComponent to use field_type instead of type for input definition 2024-06-12 01:16:38 -03:00
ogabrielluiz
682faea54b 🐛 (component.py): fix issue where input value was not being set correctly when not found in arguments 2024-06-11 23:05:51 -03:00
ogabrielluiz
9e6ede9fb0 ♻️ (OllamaModel.py): Refactor OllamaModel.py to new Component standard 2024-06-11 23:05:19 -03:00
ogabrielluiz
17065dd083 refactor: Update GroqModelComponent to use BaseLanguageModel and langflow template 2024-06-11 23:01:46 -03:00
ogabrielluiz
6c41ecf411 refactor: Update AzureOpenAIModel to use BaseLanguageModel and langflow template 2024-06-11 23:01:16 -03:00
ogabrielluiz
b14ae0cbb2 refactor: Remove build_config method from PromptComponent 2024-06-11 22:57:26 -03:00
ogabrielluiz
732ab8d443 refactor: Update get_component_instance function to handle custom component instantiation
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.
2024-06-11 22:57:21 -03:00
ogabrielluiz
2f9932da6d refactor: Update Component class to handle missing inputs in custom components
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.
2024-06-11 22:57:14 -03:00
ogabrielluiz
5cee0660e8 refactor: Update VertexAIEmbeddingsComponent to use Embeddings field type 2024-06-11 22:57:06 -03:00
ogabrielluiz
2006636229 refactor: Update OpenAIModelComponent to use BaseLanguageModel and langflow template
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.
2024-06-11 22:56:54 -03:00
ogabrielluiz
2ae46f2b08 refactor: Update LCModelComponent inheritance and imports
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.
2024-06-11 22:56:43 -03:00
ogabrielluiz
d4dff2e027 refactor: Update custom component instantiation in endpoints.py
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.
2024-06-11 22:56:36 -03:00
ogabrielluiz
ac85517361 refactor: Update Input field type to allow None as default value
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.
2024-06-11 22:56:26 -03:00
ogabrielluiz
8daaf43551 refactor: Update ChatOutput and InterfaceVertex to improve message handling
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.
2024-06-11 21:05:57 -03:00
ogabrielluiz
c3e2ad670e refactor: Remove PromptComponent and update langflow components to use Prompt field type 2024-06-11 20:49:34 -03:00
ogabrielluiz
c40188f6b6 refactor: Update VertexAIEmbeddingsComponent to use Embeddings field type
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.
2024-06-11 20:40:52 -03:00
ming
121b55231c
use Astra DB Application Token for all Astra token's display_name (#2143) 2024-06-11 16:34:54 -07:00
Lucas Oliveira
5400f61447 Merge branch 'dev' into two_edges 2024-06-11 18:46:02 -03:00
Lucas Oliveira
79e52d49b1 Changed info buttons to have Help cursor 2024-06-11 18:44:24 -03:00
Lucas Oliveira
1b23952026 Removed status when not built, adjusted Loading to have a Size 2024-06-11 18:42:34 -03:00
Lucas Oliveira
fde9a77035 Merge branch 'two_edges_merge' into two_edges 2024-06-11 18:19:59 -03:00
Lucas Oliveira
ce0f49aed5 Changed poetry.lock 2024-06-11 18:18:56 -03:00
Lucas Oliveira
850de6b952 Merge branch 'dev' into two_edges_merge 2024-06-11 18:11:13 -03:00