fix: VLM复核前将COS object key转为预签名URL
snapshot_url存储的是COS对象路径而非完整URL, VLM无法直接访问,需先生成预签名URL。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,8 +47,14 @@ async def process_alarm_notification(alarm_data: Dict):
|
||||
camera_name = alarm_data.get("camera_name", device_id)
|
||||
roi_name = alarm_data.get("scene_id", "")
|
||||
|
||||
# snapshot_url 可能是 COS object key,需转为可访问的预签名URL
|
||||
vlm_snapshot_url = snapshot_url
|
||||
if snapshot_url and not snapshot_url.startswith("http"):
|
||||
from app.services.oss_storage import get_oss_storage
|
||||
vlm_snapshot_url = get_oss_storage().get_presigned_url(snapshot_url)
|
||||
|
||||
vlm_result = await vlm_service.verify_alarm(
|
||||
snapshot_url=snapshot_url,
|
||||
snapshot_url=vlm_snapshot_url,
|
||||
alarm_type=alarm_type,
|
||||
camera_name=camera_name,
|
||||
roi_name=roi_name,
|
||||
|
||||
Reference in New Issue
Block a user