feat: wire image uploads into AI assistant chat (vision support)
- Backend: ChatMessageRequest accepts upload_ids, endpoint fetches images from S3, base64-encodes them, passes to Claude as multimodal content blocks (vision API) - Backend: add download_file() to storage_service for fetching from S3 - Frontend: handleSend collects completed upload IDs from pendingUploads and includes them in the sendChatMessage API call - Frontend: prefill handler passes upload IDs from dashboard nav state - Enables paste-screenshot → AI-sees-it flow end-to-end Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -67,6 +67,14 @@ async def upload_file(
|
||||
return storage_key
|
||||
|
||||
|
||||
def download_file(storage_key: str) -> bytes:
|
||||
"""Download a file from S3 and return its contents as bytes."""
|
||||
client = _get_client()
|
||||
buf = BytesIO()
|
||||
client.download_fileobj(settings.STORAGE_BUCKET_NAME, storage_key, buf)
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
def get_presigned_url(storage_key: str) -> str:
|
||||
"""Generate a time-limited presigned URL for downloading a file."""
|
||||
client = _get_client()
|
||||
|
||||
Reference in New Issue
Block a user