feat: standardize storage configuration and enhance backward compatibility
- Updated the `KnowledgeBase` struct to rename `cos_config` to `storage_config` for consistency across the application. - Implemented a custom `UnmarshalJSON` method to maintain backward compatibility with legacy responses that still use `cos_config`. - Modified various frontend components to reflect the new `storage_config` naming, ensuring seamless integration with the updated backend structure. - Enhanced Dockerfiles and service configurations to support the new storage engine setup. This update improves the clarity of storage configurations and ensures compatibility with existing data structures.
This commit is contained in:
@@ -92,7 +92,13 @@ func (s *ImageMultimodalService) Handle(ctx context.Context, task *asynq.Task) e
|
||||
logger.Infof(ctx, "[ImageMultimodal] Image downloaded from URL, len=%d", len(imgBytes))
|
||||
} else {
|
||||
logger.Infof(ctx, "[ImageMultimodal] Image bytes read from %s, len=%d", payload.ImageLocalPath, len(imgBytes))
|
||||
defer os.Remove(payload.ImageLocalPath)
|
||||
// Only clean up the local file when images have been re-uploaded to
|
||||
// external object storage (COS/TOS) — the serving URL will be an
|
||||
// absolute http(s) URL in that case. For local and MinIO storage the
|
||||
// local file IS the serving file and must be kept.
|
||||
if strings.HasPrefix(payload.ImageURL, "http://") || strings.HasPrefix(payload.ImageURL, "https://") {
|
||||
defer os.Remove(payload.ImageLocalPath)
|
||||
}
|
||||
}
|
||||
|
||||
imageInfo := types.ImageInfo{
|
||||
|
||||
Reference in New Issue
Block a user