Commit graph

1,259 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
77b7d8d626 refactor: Update Graph.from_payload to include flow name
This commit updates the `Graph.from_payload` method in the `endpoints.py` file to include the `flow_name` parameter. This change ensures that the `Graph` object is created with the correct flow name, which is necessary for proper functionality. By passing the `flow.name` value to the `Graph.from_payload` method, we ensure that the `graph` object is initialized correctly with the associated flow name. This improvement enhances the accuracy and reliability of the code.
2024-06-23 22:48:36 -03:00
Gabriel Luiz Freitas Almeida
ea28e8bd06 feat: Update welcome panel with telemetry information
The welcome panel in the `__main__.py` module has been updated to include information about telemetry data collection. This change adds a new line of text explaining that anonymous usage data is collected to improve Langflow, and provides instructions on how to opt-out by setting the `DO_NOT_TRACK` environment variable to `true`.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
e2b56dd125 feat: Update PlaygroundPayload componentCount field to be nullable
The `PlaygroundPayload` class in the `telemetry/schema.py` module has been updated to make the `componentCount` field nullable by setting its default value to `None`. This change allows for more flexibility when handling the `componentCount` data in the telemetry service.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
b5a0a303ba feat: Add components_count variable to retrieve_vertices_order function
This commit adds the `components_count` variable to the `retrieve_vertices_order` function in `chat.py`. The `components_count` variable is initialized as `None` and will be used for further processing within the function.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
56290ceff4 🔧 (endpoints.py): remove duplicate declaration of background_tasks parameter in simplified_run_flow function definition 2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
6577a91c59 (chat.py): Add telemetry service to log playground and component data for monitoring and debugging purposes. 2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
fdee73f63c feat: Add TelemetryService and log package run time
This commit adds the `TelemetryService` class and updates the code in `endpoints.py` to log the run time of package execution. The `TelemetryService` is responsible for handling telemetry-related functionality, including logging package run time. This addition enables the application to collect and analyze telemetry data, providing insights into the performance of package execution.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
35f2e62385 feat: Add TelemetryService schema and service
The code changes introduce the `TelemetryService` schema and service in the `langflow.services.telemetry` module. This addition enables the application to collect and analyze telemetry data.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
94be16eb43 feat: Add datetime tracking to TelemetryService shutdown 2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
d08b9bfd3d feat: Add arch and autoLogin fields to VersionPayload
The VersionPayload class in the TelemetryService module has been updated to include the arch field for architecture information and the autoLogin field to indicate whether auto login is enabled. This change enhances the telemetry data collected by the application.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
f29dcb9489 feat: Add TelemetryService and start telemetry in main.py
The code changes in `main.py` add the `get_telemetry_service()` function call to start telemetry service. This change enables the application to collect and analyze telemetry data.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
609b99e9f3 feat: Add TelemetryService and TelemetryServiceFactory
This commit adds the `TelemetryService` class and `TelemetryServiceFactory` class to the `langflow.services.telemetry` module. The `TelemetryService` is responsible for handling telemetry-related functionality, while the `TelemetryServiceFactory` is used to create instances of the `TelemetryService` class. This addition enables the application to collect and analyze telemetry data.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
597d1334b8 📝 (base.py): update comments for cache_type and variable_store attributes for clarity
📝 (base.py): add new attributes backend_only and do_not_track with their respective descriptions
📝 (base.py): add telemetry_base_url attribute with default value
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
d7b1028a43 (langflow/__main__.py): introduce setting "backend_only" in settings service to control backend behavior 2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
10eaa77399 refactor: Update get_version endpoint to use get_version_info utility function
The get_version endpoint in the API router has been updated to use the get_version_info utility function from langflow.utils.version. This change improves code organization and maintainability by centralizing the version retrieval logic.
2024-06-23 18:38:58 -07:00
Gabriel Luiz Freitas Almeida
0f5810928d chore: Update package versions in pyproject.toml files 2024-06-23 18:35:21 -07:00
Gabriel Luiz Freitas Almeida
61c34915a9 refactor: update dict to model_dump 2024-06-23 18:35:21 -07:00
Gabriel Luiz Freitas Almeida
152f0254c0 refactor: Stop tracing service gracefully 2024-06-23 18:35:21 -07:00
Gabriel Luiz Freitas Almeida
a4c9ada178 refactor: Handle exceptions and end traces in Graph class
This commit adds exception handling and trace ending functionality to the Graph class in the `base.py` file. It imports the `traceback` module and adds a try-except block to catch any exceptions that occur during graph execution. If an exception is caught, it logs the exception and ends all traces with the error message. Finally, it ensures that all traces are ended regardless of whether an exception occurred or not. This change improves the robustness and error handling of the Graph class.
2024-06-23 22:22:45 -03:00
Gabriel Luiz Freitas Almeida
54d5ba78cd fix: corret imports 2024-06-23 22:12:40 -03:00
italojohnny
2dca6262db Apply Ruff formatting 2024-06-23 15:50:05 -07:00
italojohnny
576795a471 fix regex validation for url 2024-06-23 15:50:05 -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
Lucas Oliveira
b42d340787 Changed naming of some projects 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
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
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
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