Commit graph

6 commits

Author SHA1 Message Date
Max
8471343311 Refactor storage tests to use unique filenames with UUIDs
- Introduced a `generateTestFileName` function to create unique test filenames for both local and S3 storage tests, reducing conflicts during test execution.
- Updated test cases to utilize the new filename generation method, ensuring consistent and unique identifiers for uploaded files across various scenarios.
- Enhanced readability and maintainability of test code by replacing hardcoded filenames with dynamically generated ones.
2025-07-27 10:05:50 +08:00
Max
c3b374f043 Implement LocalPath functionality for attachment management
- Added LocalPath method to the Manager and Storage interfaces to retrieve the absolute path and content type of files.
- Enhanced local and S3 storage implementations to support LocalPath, including handling gzipped files and content type detection.
- Introduced comprehensive tests for LocalPath functionality, covering various file types, non-existent files, and gzipped content.
- Updated AddFile API to utilize LocalPath for retrieving file information, improving error handling and response consistency.
2025-07-27 09:48:49 +08:00
Max
070ff59225 Enhance attachment management with file storage improvements
- Refactored the attachment manager to support file uploads with a new storage path and improved metadata handling.
- Implemented chunked uploads and direct content retrieval, enhancing performance and flexibility.
- Updated the file management API to include comprehensive operations for file uploads, downloads, and metadata management.
- Added support for multiple storage backends, including local and S3, with improved error handling and validation.
- Enhanced test coverage for file operations, ensuring reliability and consistency across different storage implementations.
2025-07-26 19:25:41 +08:00
Max
0fe42b517f Update S3 storage tests to use UUIDs for file identifiers
- Modified test cases in `storage_test.go` to generate unique file IDs using UUIDs, ensuring no conflicts during tests.
- Updated the download test for non-existent files to utilize a UUID-based identifier, enhancing test reliability.
2025-07-26 11:07:20 +08:00
Max
5d5d0d4ce9 Improve error messages in S3 storage operations
- Enhanced error handling in the S3 storage implementation by including the fileID in error messages for upload, upload chunk, merge chunks, and download operations. This change provides clearer context for debugging and improves the overall error reporting mechanism.
2025-07-25 19:15:18 +08:00
Max
435b482c38 Refactor attachment handling and enhance upload options
- Updated the API to include new upload options for handling different storage types: chat, knowledge, and assets.
- Improved group building logic for attachment uploads based on user, chat, and assistant IDs.
- Removed deprecated attachment files and refactored related code to streamline the attachment management process.
- Enhanced error handling for required fields in upload options, ensuring better validation and user feedback.
2025-07-25 17:25:12 +08:00