Commit graph

12,462 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
13d53a8533 refactor: Update GenericNode and related hooks to handle component type
This commit updates the GenericNode component and its related hooks to handle the component type. The code changes in the index.tsx file of the GenericNode directory include modifying the updateNodeCode function to accept an additional "type" parameter. The handleNodeClass function in the use-handle-node-class.tsx file has also been updated to handle the "type" parameter. These changes ensure that the GenericNode component can correctly handle different types of components and update the node code accordingly.
2024-06-23 15:25:13 -07:00
Gabriel Luiz Freitas Almeida
edc96718d7 refactor: Add CustomComponentResponse model and update custom_component endpoint
This commit adds the CustomComponentResponse model to the schemas.py file, allowing the custom_component endpoint to return a structured response. The custom_component endpoint in the endpoints.py file has been updated to include the response_model parameter, specifying the CustomComponentResponse model. This ensures that the endpoint returns the built_frontend_node along with the type of the component_instance. These changes improve the consistency and clarity of the API response.
2024-06-23 15:25:13 -07:00
Gabriel Luiz Freitas Almeida
5aa6450a3c 🔧 (config.yaml): Remove langflow config file as it is no longer needed in the project. 2024-06-23 15:24:49 -07:00
lucaseduoli
d07c2a6128 Apply Prettier formatting 2024-06-23 15:24:25 -07:00
Lucas Oliveira
b42d340787 Changed naming of some projects 2024-06-23 15:24:25 -07:00
lucaseduoli
1e1652280c Apply Prettier formatting 2024-06-23 15:24:25 -07:00
Lucas Oliveira
a8c474588c Removed markdown to not cause problems 2024-06-23 15:24:25 -07:00
Gabriel Luiz Freitas Almeida
83631d56e7 fix: correct import in json projects 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
6b1bdb6232 refactor: Remove unused import in folders.py 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
c6ad9a56fa refactor: Update build_config parameter type in AgentComponent 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
7642969f32 refactor: Update build_config parameter type in AgentComponent
The build_config parameter in the update_build_config method of the AgentComponent class has been updated to accept a field_name parameter of type str instead of Text | None. This change improves the clarity and consistency of the code.
2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
c2b2375bde Refactor field_typing module to remove Text type alias 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
d1705a7f5e refactor: Rename TextInput to MessageTextInput in starter_projects 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
93a2164543 refactor: rename TextInput to MessageTextInput 2024-06-23 15:24:11 -07:00
Gabriel Luiz Freitas Almeida
4d7cee23d8 refactor: Skip deactivated files in directory_reader.py
The code changes in `directory_reader.py` introduce a check to skip files that are located in the `deactivated` folder. This improves the efficiency of the directory reading process by excluding unnecessary files.
2024-06-23 15:23:51 -07:00
cristhianzl
d4080b81f9 💄 (paginatorComponent): update button styles to include fixed height and width
 (paginatorComponent): add size prop to buttons for consistent styling
2024-06-23 15:21:26 -07:00
cristhianzl
4dd64e486b 💄 (paginatorComponent): remove fixed height and width from paginator buttons for better responsiveness 2024-06-23 15:21:26 -07:00
Cristhian Zanforlin Lousa
00ec361e7e
Bugfix: Flows losing reference of folder when renaming current folder (#2269)
* 🐛 (folders.py): fix folder name update logic to ensure name changes are saved correctly

*  (folders.py): add custom_sort function to prioritize "My Projects" folder
♻️ (folders.py): refactor read_folders to return sorted folders using custom_sort
🐛 (folders.py): fix update_folder to refresh session after updating folder name
🐛 (folders.py): correct update statement to exclude flows not in the provided list

* Apply Ruff formatting

* ♻️ (folders.py): remove custom_sort function and replace with inline lambda for sorting folders
🐛 (folders.py): fix update statement to correctly update flows with excluded folder IDs
♻️ (folders.py): refactor folder update logic to use session.add for better clarity and consistency

---------

Co-authored-by: Cristhianzl <Cristhianzl@users.noreply.github.com>
2024-06-23 17:51:10 -03:00
Gabriel Luiz Freitas Almeida
2ae5f3b41b refactor: Remove unused import in component.py 2024-06-23 16:37:38 -03:00
Gabriel Luiz Freitas Almeida
c06227e7d0 refactor: Simplify getJsApiCode utility function
Simplify the getJsApiCode utility function in the get-js-api-code.tsx file. The unnecessary replacement of JavaScript boolean literals has been removed, improving code readability and maintainability.
2024-06-23 12:00:48 -07:00
Gabriel Luiz Freitas Almeida
590ab5135e refactor: Update CodeTabsComponent to handle additional tabs
This commit updates the CodeTabsComponent to handle an additional tab in the code tabs display. The previous implementation had a condition that checked if the active tab index was less than 4, but it has been updated to check if the active tab index is less than 5. This change ensures that the component can handle the new tab and display the corresponding content correctly. The code has been modified in the index.tsx file of the CodeTabsComponent directory.
2024-06-23 12:00:48 -07:00
Gabriel Luiz Freitas Almeida
cdbf1a62df refactor: Add getJsApiCode utility function for generating JavaScript code
This commit adds a new utility function called getJsApiCode to the apiModal/utils/get-js-api-code.tsx file. The function generates JavaScript code for interfacing with an API using the LangflowClient class. It takes several parameters including the flowId, isAuth, tweaksBuildedObject, and endpointName. The function constructs a LangflowClient instance and defines methods for making API requests, handling streams, and running flows. It also includes a main function that demonstrates how to use the LangflowClient to initiate a session and handle stream updates. This utility function improves code organization and reusability.
2024-06-23 12:00:48 -07:00
Gabriel Luiz Freitas Almeida
d1eed09c01 Fix linting errors in ToolCallingAgentComponent 2024-06-23 16:00:19 -03:00
Gabriel Luiz Freitas Almeida
67764c0182 Refactor constants.py to add Message type alias 2024-06-23 11:57:18 -07:00
Gabriel Luiz Freitas Almeida
e08db72e21 Refactor setup.py to remove call to update_new_output function 2024-06-23 11:57:18 -07:00
italojohnny
6171f3b94c update basic prompt example 2024-06-23 11:34:35 -07:00
Lucas Oliveira
55413cb751
Fix - Docs Footer and Header (#2274)
* Removed footer from docs

* Changed header icons color to match dark and light mode
2024-06-23 19:58:45 +02:00
Gabriel Luiz Freitas Almeida
438946741a Refactor constants.py to use VectorStoreRetriever in Retriever typevar 2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
659793fcee fix: correct argument for cohere_api_key 2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
dc259c7d57 Refactor create_or_update_starter_projects function in setup.py for better code organization
The create_or_update_starter_projects function in setup.py has been refactored to improve code organization. This change separates the function definition from the rest of the code, making it easier to read and maintain.
2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
cdfed9c3c2 Refactor LCVectorStoreComponent to set status when building retriever 2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
184a6d1342 chore: Add Cohere Rerank component for document reranking 2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
80d0b3e625 Refactor Retriever class in constants.py for better organization
The Retriever class in constants.py has been refactored to improve code organization. This change separates the class definition from the rest of the code, making it easier to read and maintain.
2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
e27583c3f9 Refactor set_user_agent method in base.py for proper capitalization 2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
5e33628959 chore: Update post_process_raw function in artifact.py
The post_process_raw function in artifact.py has been updated to set the raw value to "Built Successfully " when the artifact type is unknown. This change improves the clarity of the code and provides a more meaningful message for unknown artifact types.
2024-06-23 09:26:51 -07:00
Gabriel Luiz Freitas Almeida
ab9083d066 refactor: Update ToolCallingAgentComponent description
Update the description of the ToolCallingAgentComponent class in ToolCallingAgent.py to improve clarity and conciseness.
2024-06-23 01:53:02 -03:00
Gabriel Luiz Freitas Almeida
22839ee270 refactor: Update post_code_processing method in CustomComponent class
Refactor the post_code_processing method in the CustomComponent class to improve code readability and maintainability. The changes include:

- Import the update_frontend_node_with_template_values function from langflow.template.utils.
- Update the function signature to accept new_build_config and current_build_config as parameters.
- Call the update_frontend_node_with_template_values function to update the frontend_node with any values set in the current_build_config.
- Remove unnecessary comments and whitespace.

These changes enhance the overall quality of the code and make it easier to understand and maintain.
2024-06-23 01:52:55 -03:00
ming luo
b1e7a8b288 prevent race condiction on drop_and_create_table_if_schema_mismatch 2024-06-22 21:43:29 -07:00
Rodrigo
0253b15a2c refactor: Update AstraVectorStoreComponent display name 2024-06-23 00:52:51 -03:00
Rodrigo
2f7d24fb11 fix: Update ToolCallingAgentComponent 2024-06-23 00:51:13 -03:00
Gabriel Luiz Freitas Almeida
6794a5542f refactor: Update Makefile to ignore integration tests in unit_tests
The Makefile has been updated to ignore the integration tests when running the unit_tests target. This change improves the efficiency of the unit testing process by excluding unnecessary tests.
2024-06-22 23:45:24 -03:00
Gabriel Luiz Freitas Almeida
a9b2f5f82e refactor: Remove unused import and simplify post_code_processing method 2024-06-22 17:39:37 -07:00
ogabrielluiz
86f8b3e945 Apply Prettier formatting 2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
55f3ceb0ed refactor: Update PromptComponent post_code_processing method
Refactor the post_code_processing method in the PromptComponent class to improve code readability and maintainability. The changes include:

- Import the process_prompt_template function from langflow.base.prompts.api_utils.
- Import the update_template_values function from langflow.template.utils.
- Call the process_prompt_template function to update the template value.
- Update the frontend_node with any values set in the current_build_config.
- Remove unnecessary comments and whitespace.

These changes enhance the overall quality of the code and make it easier to understand and maintain.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
a9040a4b4e refactor: Rename post_code_validation method to post_code_processing
The post_code_validation method in the Component class has been renamed to post_code_processing to better reflect its purpose. This change improves code clarity and maintainability.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
69b756c35b refactor: Update build_custom_component_template return type
Update the return type of the build_custom_component_template function in utils.py to include the possibility of returning a Component object. This change ensures that the function can handle both CustomComponent and Component objects, improving flexibility and compatibility.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
95d666636b refactor: Update post_code_validation method in Component class
Refactor the post_code_validation method in the Component class to improve code readability and maintainability. The changes include:

- Rename the parameters to better reflect their purpose.
- Update the function documentation to provide a clear explanation of the method's purpose.
- Remove unnecessary comments and whitespace.
- Improve variable naming for better clarity.

These changes enhance the overall quality of the code and make it easier to understand and maintain.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
63cb3baca4 refactor: move prompt utils to template module 2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
8f2232575d refactor: Handle error updating Component code in GenericNode
When updating the Component code in GenericNode, handle any errors that occur. If an error occurs, display an error message with instructions to report the issue on Discord or GitHub. This improves the error handling and user experience when updating the Component code.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
f4517b250e refactor: remove Prompt from ignored components list 2024-06-22 17:39:37 -07:00