This commit simplifies the handling of the JWT token in the upload_user_file and run_ingestion functions by removing unnecessary lines and ensuring the token is passed correctly to downstream services. This change enhances code readability and maintains the focus on robust async coding practices and well-documented code.
This commit modifies the AppClients class to remove the Content-Type header if it is explicitly set to None, particularly for file uploads. This change enhances the robustness of the async code by ensuring proper header management during API requests, aligning with the project's focus on well-documented and maintainable code.
This commit replaces the print statement with a logger.info call in the initialize_services function, enhancing the logging practices for better error tracking and consistency across the codebase. This change aligns with the project's focus on robust async coding and well-documented code.
This commit streamlines the LangflowFileService by removing direct HTTP client usage in favor of a centralized API client for handling requests. It enhances the upload and delete file methods to improve code organization and maintainability. Additionally, it updates logging practices for better error visibility, ensuring adherence to robust async coding standards and documentation practices.
This commit updates the settings for LANGFLOW_INGEST_FLOW_ID to remove reliance on a deprecated environment variable. It introduces a new Langflow HTTP client for making API requests and adds a centralized method for handling Langflow API requests, improving code organization and maintainability. The changes enhance the robustness of the async code while ensuring proper documentation practices are followed.
This commit replaces the print statement for error traceback with a structured logging approach using the logger. This change enhances error visibility and aligns with best practices for robust and well-documented async code.
This commit adds functionality to retrieve and set ingestion-specific defaults from the Langflow API based on the flow configuration. It includes error handling for the API call and updates the settings with values for chunk size, chunk overlap, separator, and embedding model based on the flow data. This enhancement improves the flexibility and robustness of the ingestion process.
This commit updates the settings retrieval function to include new flow IDs for chat and ingestion, replacing the deprecated FLOW_ID. It also improves the logic for exposing edit URLs based on the availability of public URLs, contributing to a more robust and well-documented codebase.
This commit adds detailed debug and error logging to the upload_user_file endpoint, facilitating better tracking of file upload processes and issues. It includes checks for the presence of a file and JWT token, and captures exceptions with traceback information for enhanced debugging. These changes contribute to a more robust and well-documented codebase.
This commit introduces backwards compatibility for the flow ID by allowing the use of the deprecated FLOW_ID environment variable while issuing deprecation warnings. Additionally, the API key generation process has been improved with validation checks for cached keys and enhanced error handling. The Langflow client initialization has been updated to ensure proper handling of environment variables, contributing to a more robust and well-documented codebase.
This commit refactors the LangflowFileService to include asynchronous API key retrieval and updates the file upload and deletion methods to use the new v2 endpoints. The flow ID constant has been renamed for clarity, and additional logging has been added for better debugging and error handling. The payload structure for the ingestion flow has also been modified to improve functionality and maintainability.
This commit enhances the TaskService class by reorganizing import statements, updating type hints to use `dict` instead of `Dict`, and improving the formatting of method definitions for better clarity. Additionally, minor adjustments were made to comments and error handling, contributing to a more robust and well-documented codebase.
This commit reorganizes the import statements in main.py, enhancing the structure and readability of the code. It also includes minor formatting adjustments for consistency. The changes contribute to a cleaner codebase, facilitating easier maintenance and future development.
This commit integrates the LangflowFileService into main.py, enabling the management of user files through new asynchronous API endpoints for file upload, ingestion, and deletion. The changes enhance the application's functionality and maintainability by providing structured access to Langflow file operations, while ensuring proper authentication and session management for each endpoint.
This commit refactors the import statements in settings.py, enhancing the organization and readability of the code. The changes include consolidating and reordering imports, which contributes to a cleaner and more maintainable codebase.
This commit reorganizes the import statements in main.py for better clarity and structure. It consolidates API endpoint imports and service imports, ensuring a cleaner and more maintainable codebase. Additionally, it updates the print statement for connection loading to improve logging consistency.
This commit introduces three asynchronous API endpoints in langflow_files.py: upload_user_file, run_ingestion, and delete_user_files. Each endpoint handles file operations with appropriate error handling and returns JSON responses. The implementation ensures robust interaction with the LangflowFileService for managing user files.
This commit introduces the LangflowFileService class, which provides methods for uploading user files, deleting user files, and triggering an ingestion flow using the Langflow Files API. The service is designed to handle asynchronous operations and includes error handling for API requests. Documentation for each method is included to ensure clarity on usage.